backtrace-rs icon indicating copy to clipboard operation
backtrace-rs copied to clipboard

Parse short backtraces out of debuginfo

Open jyn514 opened this issue 10 months ago • 0 comments

This implements the runtime side of https://github.com/rust-lang/compiler-team/issues/818.

  • Extract a helper out of find_frames for iterating over a LookupContinuation
  • Make the type signature for search_object_map consistent across all platforms. Backtraces are inherently platform specific, but let's not make it any harder on ourselves than we have to.
  • Add a new pub fn short_backtraces() -> enum { ThisFrameOnly, Start, End } API
  • Use the new gimli::UnitRef::shared_attrs API to determine whether a given frame has a short backtrace. This, for now, requires a git dependency on gimli.

Note that this currently does not work on MacOS. I do not have a Mac to test this; someone lent me theirs and I tracked it down to cx.find_dwarf_and_unit returning None, but I have not had the time or resources to narrow it down further than that.

jyn514 avatar Jan 21 '25 05:01 jyn514