pub struct DebugInfo { /* private fields */ }
Expand description

Debug information which is parsed from DWARF debugging information.

Implementations§

Read debug info directly from a ELF file.

Parse debug information directly from a buffer containing an ELF file.

Get the name of the function at the given address.

If no function is found, None will be returend.

Inlined functions

Multiple nested inline functions could exist at the given address. This function will currently return the innermost function in that case.

Try get the SourceLocation for a given address.

This effects the on-demand expansion of lazy/deferred load of all the ‘child’ Variables for a given ‘parent’.

Performs the logical unwind of the stack and returns a Vec<StackFrame>

  • The first ‘StackFrame’ represents the frame at the current PC (program counter), and …
  • Each subsequent StackFrame represents the previous or calling StackFrame in the call stack.
  • The majority of the work happens in the 'unwind: while loop, where each iteration will create a StackFrame where possible, and update the unwind_registers to prepare for the next iteration.

The unwind loop will continue until we meet one of the following conditions:

  • We can no longer unwind a valid PC value to be used for the next frame.
  • We encounter a LR register value of 0x0 or 0xFFFFFFFF(Arm ‘Reset’ value for that register).
  • TODO: Catch the situation where the PC value indicates a hard-fault or other non-recoverable exception
  • We can not intelligently calculate a valid LR register value from the other registers, or the gimli::RegisterRule result is a value of 0x0. Note: DWARF 6.4.4 - CIE defines the return register address used in the gimli::RegisterRule tables for unwind operations. Theoretically, if we encounter a function that has Undefined gimli::RegisterRule for the return register address, it means we have reached the bottom of the stack OR the function is a ‘no return’ type of function. I have found actual examples (e.g. local functions) where we get Undefined for register rule when we cannot apply this logic. Example 1: local functions in main.rs will have LR rule as Undefined. Example 2: main()-> ! that is called from a trampoline will have a valid LR rule.
  • Similarly, certain error conditions encountered in StackFrameIterator will also break out of the unwind loop. Note: In addition to populating the StackFrames, this function will also populate the DebugInfo::VariableCache with Variables for available Registers as well as static and function variables. TODO: Separate logic for stackframe creation and cache population

Find the program counter where a breakpoint should be set, given a source file, a line and optionally a column.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted.
Causes self to use its LowerExp implementation when Debug-formatted.
Causes self to use its LowerHex implementation when Debug-formatted.
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted.
Causes self to use its UpperExp implementation when Debug-formatted.
Causes self to use its UpperHex implementation when Debug-formatted.
Formats each item in a sequence. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function.
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function.
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds.
Calls .tap_borrow() only in debug builds, and is erased in release builds.
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Calls .tap_ref() only in debug builds, and is erased in release builds.
Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Calls .tap_deref() only in debug builds, and is erased in release builds.
Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more