class Location

Defined at line 20 of file ../../src/developer/debug/zxdb/symbols/location.h

Represents all the symbol information for a code location.

Public Methods

void Location ()

Defined at line 15 of file ../../src/developer/debug/zxdb/symbols/location.cc

void Location (State state, uint64_t address)

Defined at line 16 of file ../../src/developer/debug/zxdb/symbols/location.cc

void Location (uint64_t address, FileLine file_line, int column, const SymbolContext & symbol_context, LazySymbol symbol)

Symbolized location.

Defined at line 18 of file ../../src/developer/debug/zxdb/symbols/location.cc

void Location (const SymbolContext & symbol_context, LazySymbol symbol)

Unlocated variable.

Defined at line 27 of file ../../src/developer/debug/zxdb/symbols/location.cc

void AddAddressOffset (uint64_t offset)

Offsets the code addresses in this by adding an amount. This is used to convert module-relative

addresses to global ones by adding the module load address.

Defined at line 32 of file ../../src/developer/debug/zxdb/symbols/location.cc

bool EqualsIgnoringSymbol (const Location & other)

Returns if this location is the same as the other one, ignoring the symbol() object. Comparing

symbol objects is dicy because the same symbol can result in a different object depending on

how it is found or whether it was re-queried.

This function is primarily used for tests, in which case comparing object pointer equality

might be good enough. For non-tests, one might compare symbols by name.

Defined at line 38 of file ../../src/developer/debug/zxdb/symbols/location.cc

const char * StateToString (State state)

Returns a string version of the State enum for debugging purposes.

Defined at line 44 of file ../../src/developer/debug/zxdb/symbols/location.cc

std::string GetDebugString ()

Returns a description of this Location for debugging purposes.

Defined at line 58 of file ../../src/developer/debug/zxdb/symbols/location.cc

bool is_valid ()

Defined at line 62 of file ../../src/developer/debug/zxdb/symbols/location.h

bool is_symbolized ()

The different between "symbolized" and "has_symbols" is that the former means we tried to

symbolize it, and the latter means we actually succeeded to symbolize EITHER the line or the

function. One or the other could be missing, however.

Defined at line 67 of file ../../src/developer/debug/zxdb/symbols/location.h

bool has_symbols ()

Defined at line 68 of file ../../src/developer/debug/zxdb/symbols/location.h

uint64_t address ()

The absolute address of this location.

Defined at line 71 of file ../../src/developer/debug/zxdb/symbols/location.h

const FileLine & file_line ()

Defined at line 73 of file ../../src/developer/debug/zxdb/symbols/location.h

int column ()

Defined at line 74 of file ../../src/developer/debug/zxdb/symbols/location.h

const LazySymbol & symbol ()

The symbol associated with this address, if any. In the case of code this will most commonly be

a Function. It will not be a non-function code block inside the function (code wanting lexical

blocks can look inside the function's children as needed). It could also be a variable symbol

corresponding to a global or static variable or an ELF symbol.

When looking up code locations from the symbol system and the address is non-ambiguous,

this will be the most specific (possibly inline) function covering the address in

question. For ambiguous inline locations this will either be the most specific inline function

or the non-inline function (least-specific) according to ResolveOptions.ambiguous_inline (see

that variable for more on ambiguous inline locations).

A function can have different scopes inside of it. To get the current lexical scope inside the

function, use GetMostSpecificChild() on it.

This isn't necessarily valid, even if the State == kSymbolized. It could be the symbol table

indicates file/line info for this address but could lack a function record for it.

Defined at line 92 of file ../../src/developer/debug/zxdb/symbols/location.h

const SymbolContext & symbol_context ()

Symbolized locations will have a valid symbol context for converting addresses.

Defined at line 95 of file ../../src/developer/debug/zxdb/symbols/location.h

Enumerations

enum State
Name Value
kInvalid 0
kAddress 1
kSymbolized 2
kUnlocatedVariable 3

A location can be invalid (has no address), can have an address that we haven't tried to

symbolize, and a symbolized address. The latter two states allow symbolizing on demand without

having additional types.

The "symbolized" state doesn't necessarily mean there are symbols, it just means we tried to

symbolize it.

Defined at line 28 of file ../../src/developer/debug/zxdb/symbols/location.h