Changeset View
Changeset View
Standalone View
Standalone View
lldb/include/lldb/Symbol/Symbol.h
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | Address GetAddress() const { | ||||
// GetAddress() accessor, we need to hand out an invalid address if the | // GetAddress() accessor, we need to hand out an invalid address if the | ||||
// symbol's value isn't an address. | // symbol's value isn't an address. | ||||
if (ValueIsAddress()) | if (ValueIsAddress()) | ||||
return m_addr_range.GetBaseAddress(); | return m_addr_range.GetBaseAddress(); | ||||
else | else | ||||
return Address(); | return Address(); | ||||
} | } | ||||
/// Get the raw value of the symbol from the symbol table. | |||||
/// | |||||
/// If the symbol's value is an address, return the file address, else return | |||||
/// the raw value that is stored in the m_addr_range. If the base address has | |||||
/// no section, then getting the file address will return the correct value | |||||
/// as it will return the offset in the base address which is the value. | |||||
uint64_t GetRawValue() const { | |||||
return m_addr_range.GetBaseAddress().GetFileAddress(); | |||||
} | |||||
// When a symbol's value isn't an address, we need to access the raw value. | // When a symbol's value isn't an address, we need to access the raw value. | ||||
// This function will ensure this symbol's value isn't an address and return | // This function will ensure this symbol's value isn't an address and return | ||||
// the integer value if this checks out, otherwise it will return | // the integer value if this checks out, otherwise it will return | ||||
// "fail_value" if the symbol is an address value. | // "fail_value" if the symbol is an address value. | ||||
uint64_t GetIntegerValue(uint64_t fail_value = 0) const { | uint64_t GetIntegerValue(uint64_t fail_value = 0) const { | ||||
if (ValueIsAddress()) { | if (ValueIsAddress()) { | ||||
// This symbol's value is an address. Use Symbol::GetAddress() to get the | // This symbol's value is an address. Use Symbol::GetAddress() to get the | ||||
// address. | // address. | ||||
▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines |