Stream: general

Topic: extracting backtrace data

zeroexcuses (May 09 2020 at 18:55, on Zulip):

How do I extract

struct Capture {
    actual_start: usize,
    resolved: bool,
    frames: Vec<BacktraceFrame>,

from ?

In particular, I don't want to just print the Backtrace via debug. Instead, I want to run through the backtrace frames and print only a subset.

Mark Drobnak (May 09 2020 at 19:09, on Zulip):

Capture is a private type, so you probably can't get that directly. You probably want to use the backtrace crate, which has a frames method and supports stable as well.

zeroexcuses (May 09 2020 at 20:53, on Zulip):

Interesting. I (incorrectly) thought crate backtrace-rs was for pre-feature-std::backtrace. I did not realize the two were meant to be used together.

RalfJ (May 10 2020 at 09:08, on Zulip):

not sure if "used together" is the right term -- std does not expose that it uses the backtrace crate under the hood

RalfJ (May 10 2020 at 09:08, on Zulip):

you can use one or the other, the backend is the same. std will provide very strong stability guarantees once it is stable. the crate API has been refined less and might see breaking changes in the future.

Last update: May 29 2020 at 17:30UTC