If your Emacs is segfaulting, you can explicitly write to stderr when debugging, so you have trace information! This even works when you are running Emacs with a GUI.
(print "hello world" #'external-debugging-output)
Rust's dbg! macro (new in 1.32) is delightful. You write dbg!(my_var) and you get a print statement that writes:
[src/my_file.rs:123] my_var = "value of my_var"
It's a huge ergonomic help when debugging!