Crate stack_trace

source ·
Expand description

Stack trace (backtrace) functionality using DWARF debugging information.

There are two main ways of obtaining stack traces:

  1. Using the frame pointer register to find the previous stack frame.
  2. Using DWARF debugging information to understand the layout of each stack frame.

We support both ways, but prefer #2 because it doesn’t suffer from the compatibility and performance drawbacks of #1. See the stack_trace_frame_pointers crate for the #1 functionality.

This crate offers support for #2. The advantage of using this is that it should always be possible regardless of how the compiler was configured. However, this crate requires more dependencies, and if object files have been specifically stripped of DWARF info, then we won’t be able to recurse up the call stack.

Structs

  • This struct represents a namespace of crates and their “global” (publicly-visible) symbols. A crate namespace struct is basically a container around many crates that have all been loaded and linked against each other, completely separate and in isolation from any other crate namespace (although a given crate may be shared across multiple namespaces).

Functions

  • Returns a cloned reference to the current task.
  • Get a stack trace using the default stack tracer based on DWARF debug info.

Type Aliases