Death::Backward::ResolvedTrace struct

Resolved trace item.

Base classes

struct Trace
Raw trace item.

Public types

struct SourceLoc
Source location description.
using source_locs_t = std::vector<SourceLoc>

Constructors, destructors, conversion operators

ResolvedTrace()
ResolvedTrace(const Trace& baseTrace)

Public functions

void ShiftInlinerFunctionNames()
Relabels every source location with the function that actually contains it.

Public variables

std::string ObjectFilename
void* ObjectBaseAddress
std::string ObjectFunction
SourceLoc Source
source_locs_t Inliners

Function documentation

void Death::Backward::ResolvedTrace::ShiftInlinerFunctionNames()

Relabels every source location with the function that actually contains it.

DWARF describes an inlined call as the name of the function that was inlined paired with the location it was called from — and that location lies in the caller, not in the named function. A resolver that copies both verbatim mislabels every line of the report by one step: Source ends up holding the line the address maps to (which is inside the innermost inlined function) next to the name of the concrete function containing the whole chain, and each Inliners entry holds a call site next to the name of the function that call enters.

This shifts the names one step inwards to undo it. It expects Inliners ordered innermost-first and Source's function holding the concrete function's name, which is how the two DWARF resolvers fill them in — BFD reports both correctly on its own and must not call this.