[rust-dev] Failure stacktraces

Corey Richardson corey at octayn.net
Sun Jan 19 10:05:11 PST 2014


You're not actually seeing a stack entry, you're seeing the string
that was given to `fail!()`. You can get a real backtrace with gdb,
break on `rust_fail`. You can also get a super crappy backtrace using
the backtrace function, see prototype
https://gist.github.com/cmr/8192817. We used to use it, but it only
really works for dynamic linking (which we discourage for a variety of
reasons right now), and doesn't work on OS X.

Getting a real backtrace when unwinding would be possible, but we'd
need to start parsing DWARF etc. Not trivial.

On Sun, Jan 19, 2014 at 12:58 PM, Vladimir Matveev
<dpx.infinity at gmail.com> wrote:
> Hi,
>
> Is it possible to view full stacktraces when task fails? Currently
> only the last item in the stacktrace is printed to the terminal when I
> run a failing program. I'm very surprised that I was not able to find
> any information on this. It looks like that the problem is
> nonexistent. However, the ability of getting full failure stacktraces
> is of colossal importance. Failures mean stack unwinding, so it
> shouldn't be a problem, should it?
>
> Thanks,
> Vladimir.
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev


More information about the Rust-dev mailing list