class DwarfDieScanner
Defined at line 41 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.h
This is a helper class for generating a zxdb::Index.
It works in two phases. In the first, it linearly iterates through the DIEs of a unit. The
calling code does:
while (!scanner.done()) {
current_die = scanner.Prepare();
... work on current_die ...
scanner.Advance();
}
In the second phase, the scanner can provide extra information for a DIE in the unit in constant
time.
This class exists because in LLVM, getting the parent of a DIE used to require an inefficient
linear search. Since LLVM provides a direct way to get parent index, the necessity of this class
is largely elimiated.
Public Members
static const uint32_t kNoParent
Public Methods
void DwarfDieScanner (const DwarfUnit & unit)
The unit must outlive this class.
Defined at line 14 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.cc
void ~DwarfDieScanner ()
Defined at line 21 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.cc
const llvm::DWARFDebugInfoEntry * Prepare ()
Call at the beginning of each iteration (when !done()) to get the current DIE. This is required
to be called before Advance() as it sets some internal state.
Defined at line 23 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.cc
void Advance ()
Advances to the next DIE.
Defined at line 56 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.cc
uint32_t die_index ()
Defined at line 57 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.h
uint32_t die_count ()
Defined at line 58 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.h
bool done ()
Defined at line 60 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.h
uint32_t GetParentIndex (uint32_t index)
Return the parent's index of a DIE in constant time. Will return kNoParent for the root.
Defined at line 62 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.cc
bool is_inside_function ()
Returns true if the current stack position is considered to be directly inside a function.
Lexical blocks count as being inside a function, but if a new type is defined inside a function
the children of that type are no longer considered to be inside a function.
This is used to avoid indexing function-local variables.
Defined at line 67 of file ../../src/developer/debug/zxdb/symbols/dwarf_die_scanner.h