LLDB mainline
|
"lldb/Expression/DWARFExpressionList.h" Encapsulates a range map from file address range to a single DWARF location expression. More...
#include <DWARFExpressionList.h>
Classes | |
struct | DWARFExpressionCompare |
Public Member Functions | |
DWARFExpressionList ()=default | |
DWARFExpressionList (lldb::ModuleSP module_sp, const plugin::dwarf::DWARFUnit *dwarf_cu, lldb::addr_t func_file_addr) | |
DWARFExpressionList (lldb::ModuleSP module_sp, DWARFExpression expr, const plugin::dwarf::DWARFUnit *dwarf_cu) | |
bool | IsValid () const |
Return true if the location expression contains data. | |
void | Clear () |
bool | IsAlwaysValidSingleExpr () const |
bool | AddExpression (lldb::addr_t base, lldb::addr_t end, DWARFExpression expr) |
bool | GetExpressionData (DataExtractor &data, lldb::addr_t func_load_addr=LLDB_INVALID_ADDRESS, lldb::addr_t file_addr=0) const |
Get the expression data at the file address. | |
void | Sort () |
Sort m_expressions. | |
void | SetFuncFileAddress (lldb::addr_t func_file_addr) |
lldb::addr_t | GetFuncFileAddress () |
const DWARFExpression * | GetExpressionAtAddress (lldb::addr_t func_load_addr, lldb::addr_t load_addr) const |
const DWARFExpression * | GetAlwaysValidExpr () const |
DWARFExpression * | GetMutableExpressionAtAddress (lldb::addr_t func_load_addr=LLDB_INVALID_ADDRESS, lldb::addr_t load_addr=0) |
size_t | GetSize () const |
bool | ContainsThreadLocalStorage () const |
bool | LinkThreadLocalStorage (lldb::ModuleSP new_module_sp, std::function< lldb::addr_t(lldb::addr_t file_addr)> const &link_address_callback) |
bool | MatchesOperand (StackFrame &frame, const Instruction::Operand &operand) const |
bool | DumpLocations (Stream *s, lldb::DescriptionLevel level, lldb::addr_t func_load_addr, lldb::addr_t file_addr, ABI *abi) const |
Dump locations that contains file_addr if it's valid. | |
void | GetDescription (Stream *s, lldb::DescriptionLevel level, ABI *abi) const |
Dump all locaitons with each separated by new line. | |
bool | ContainsAddress (lldb::addr_t func_load_addr, lldb::addr_t addr) const |
Search for a load address in the dwarf location list. | |
void | SetModule (const lldb::ModuleSP &module) |
llvm::Expected< Value > | Evaluate (ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::addr_t func_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr) const |
Private Types | |
using | ExprVec = RangeDataVector< lldb::addr_t, lldb::addr_t, DWARFExpression, 0, DWARFExpressionCompare > |
using | Entry = ExprVec::Entry |
using | const_iterator = ExprVec::Collection::const_iterator |
Private Member Functions | |
const_iterator | begin () const |
const_iterator | end () const |
Private Attributes | |
ExprVec | m_exprs |
lldb::ModuleWP | m_module_wp |
Module which defined this expression. | |
const plugin::dwarf::DWARFUnit * | m_dwarf_cu = nullptr |
The DWARF compile unit this expression belongs to. | |
lldb::addr_t | m_func_file_addr = LLDB_INVALID_ADDRESS |
"lldb/Expression/DWARFExpressionList.h" Encapsulates a range map from file address range to a single DWARF location expression.
Definition at line 28 of file DWARFExpressionList.h.
|
private |
Definition at line 151 of file DWARFExpressionList.h.
|
private |
Definition at line 135 of file DWARFExpressionList.h.
|
private |
Definition at line 133 of file DWARFExpressionList.h.
|
default |
|
inline |
Definition at line 32 of file DWARFExpressionList.h.
|
inline |
Definition at line 38 of file DWARFExpressionList.h.
References AddExpression(), and LLDB_INVALID_ADDRESS.
bool DWARFExpressionList::AddExpression | ( | lldb::addr_t | base, |
lldb::addr_t | end, | ||
DWARFExpression | expr | ||
) |
Definition at line 33 of file DWARFExpressionList.cpp.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::Append(), end(), IsAlwaysValidSingleExpr(), and m_exprs.
Referenced by DWARFExpressionList(), lldb_private::npdb::GetVariableLocationInfo(), and lldb_private::DWARFExpression::ParseDWARFLocationList().
|
inlineprivate |
Definition at line 152 of file DWARFExpressionList.h.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::begin(), and m_exprs.
|
inline |
Definition at line 47 of file DWARFExpressionList.h.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::Clear(), and m_exprs.
Referenced by lldb_private::DWARFExpression::ParseDWARFLocationList().
bool DWARFExpressionList::ContainsAddress | ( | lldb::addr_t | func_load_addr, |
lldb::addr_t | addr | ||
) | const |
Search for a load address in the dwarf location list.
[in] | func_load_addr | The actual address of the function containing this location list. |
[in] | addr | The address to resolve. |
Definition at line 50 of file DWARFExpressionList.cpp.
References GetExpressionAtAddress(), and IsAlwaysValidSingleExpr().
Referenced by lldb_private::Variable::LocationIsValidForAddress(), and lldb_private::Variable::LocationIsValidForFrame().
bool DWARFExpressionList::ContainsThreadLocalStorage | ( | ) | const |
Definition at line 85 of file DWARFExpressionList.cpp.
References lldb_private::DWARFExpression::ContainsThreadLocalStorage(), lldb_private::RangeData< B, S, T >::data, lldb_private::RangeDataVector< B, S, T, N, Compare >::GetEntryRef(), IsAlwaysValidSingleExpr(), m_dwarf_cu, and m_exprs.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
bool DWARFExpressionList::DumpLocations | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
lldb::addr_t | func_load_addr, | ||
lldb::addr_t | file_addr, | ||
ABI * | abi | ||
) | const |
Dump locations that contains file_addr if it's valid.
Otherwise. dump all locations.
Definition at line 142 of file DWARFExpressionList.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::RangeData< B, S, T >::data, lldb_private::DataExtractor::GetAddressByteSize(), GetAlwaysValidExpr(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::Range< B, S >::GetRangeEnd(), LLDB_INVALID_ADDRESS, and m_func_file_addr.
Referenced by lldb_private::Variable::DumpLocations().
|
inlineprivate |
Definition at line 153 of file DWARFExpressionList.h.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::end(), and m_exprs.
Referenced by AddExpression().
llvm::Expected< Value > DWARFExpressionList::Evaluate | ( | ExecutionContext * | exe_ctx, |
RegisterContext * | reg_ctx, | ||
lldb::addr_t | func_load_addr, | ||
const Value * | initial_value_ptr, | ||
const Value * | object_address_ptr | ||
) | const |
Definition at line 201 of file DWARFExpressionList.cpp.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::Back(), lldb_private::RangeData< B, S, T >::data, lldb_private::DWARFExpression::Evaluate(), GetExpressionAtAddress(), lldb_private::DWARFExpression::GetExpressionData(), lldb_private::ExecutionContext::GetFramePtr(), lldb_private::RegisterContext::GetPCForSymbolication(), lldb_private::StackFrame::GetRegisterContext(), lldb_private::DWARFExpression::GetRegisterKind(), lldb_private::ExecutionContext::GetTargetPtr(), IsAlwaysValidSingleExpr(), m_dwarf_cu, m_exprs, m_module_wp, and pc.
Referenced by Evaluate_DW_OP_entry_value(), lldb_private::IndirectCallEdge::GetCallee(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetGlobalAranges(), lldb_private::RegisterContextUnwind::ReadFrameAddress(), lldb_private::RegisterContextUnwind::SavedLocationForRegister(), and lldb_private::ValueObjectVariable::UpdateValue().
const DWARFExpression * DWARFExpressionList::GetAlwaysValidExpr | ( | ) | const |
Definition at line 24 of file DWARFExpressionList.cpp.
References lldb_private::RangeData< B, S, T >::data, lldb_private::RangeDataVector< B, S, T, N, Compare >::GetEntryAtIndex(), lldb_private::RangeDataVector< B, S, T, N, Compare >::GetSize(), LLDB_INVALID_ADDRESS, and m_exprs.
Referenced by DumpLocations(), GetExpressionAtAddress(), IsAlwaysValidSingleExpr(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
void DWARFExpressionList::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
ABI * | abi | ||
) | const |
Dump all locaitons with each separated by new line.
Definition at line 176 of file DWARFExpressionList.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::RangeDataVector< B, S, T, N, Compare >::Back(), lldb_private::RangeData< B, S, T >::data, lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::Stream::GetIndentLevel(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::Range< B, S >::GetRangeEnd(), IsAlwaysValidSingleExpr(), and m_exprs.
Referenced by lldb_private::Variable::Dump().
const DWARFExpression * DWARFExpressionList::GetExpressionAtAddress | ( | lldb::addr_t | func_load_addr, |
lldb::addr_t | load_addr | ||
) | const |
Definition at line 58 of file DWARFExpressionList.cpp.
References lldb_private::RangeData< B, S, T >::data, lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryIndexThatContains(), GetAlwaysValidExpr(), lldb_private::RangeDataVector< B, S, T, N, Compare >::GetEntryAtIndex(), LLDB_INVALID_ADDRESS, m_exprs, m_func_file_addr, and UINT32_MAX.
Referenced by ContainsAddress(), Evaluate(), GetExpressionData(), and MatchesOperand().
bool DWARFExpressionList::GetExpressionData | ( | DataExtractor & | data, |
lldb::addr_t | func_load_addr = LLDB_INVALID_ADDRESS , |
||
lldb::addr_t | file_addr = 0 |
||
) | const |
Get the expression data at the file address.
Definition at line 41 of file DWARFExpressionList.cpp.
References GetExpressionAtAddress().
Referenced by lldb_private::ClangExpressionDeclMap::GetVariableValue(), and lldb_private::ValueObjectVariable::UpdateValue().
|
inline |
Definition at line 66 of file DWARFExpressionList.h.
References m_func_file_addr.
DWARFExpression * DWARFExpressionList::GetMutableExpressionAtAddress | ( | lldb::addr_t | func_load_addr = LLDB_INVALID_ADDRESS , |
lldb::addr_t | load_addr = 0 |
||
) |
Definition at line 72 of file DWARFExpressionList.cpp.
References lldb_private::RangeData< B, S, T >::data, lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryIndexThatContains(), lldb_private::RangeDataVector< B, S, T, N, Compare >::GetMutableEntryAtIndex(), IsAlwaysValidSingleExpr(), LLDB_INVALID_ADDRESS, m_exprs, m_func_file_addr, and UINT32_MAX.
Referenced by fixupExternalAddrZeroVariable(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE(), lldb_private::RegisterContextUnwind::ReadFrameAddress(), and lldb_private::RegisterContextUnwind::SavedLocationForRegister().
|
inline |
Definition at line 77 of file DWARFExpressionList.h.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::GetSize(), and m_exprs.
bool DWARFExpressionList::IsAlwaysValidSingleExpr | ( | ) | const |
Definition at line 20 of file DWARFExpressionList.cpp.
References GetAlwaysValidExpr().
Referenced by AddExpression(), ContainsAddress(), ContainsThreadLocalStorage(), Evaluate(), GetDescription(), lldb_private::StackFrame::GetFrameBaseValue(), GetMutableExpressionAtAddress(), LinkThreadLocalStorage(), lldb_private::Variable::LocationIsValidForAddress(), MatchesOperand(), and lldb_private::ValueObjectVariable::UpdateValue().
|
inline |
Return true if the location expression contains data.
Definition at line 45 of file DWARFExpressionList.h.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::IsEmpty(), and m_exprs.
Referenced by lldb_private::npdb::SymbolFileNativePDB::CreateLocalVariable(), lldb_private::Variable::Dump(), DWARFASTParserClang::ParseFunctionFromDWARF(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
bool DWARFExpressionList::LinkThreadLocalStorage | ( | lldb::ModuleSP | new_module_sp, |
std::function< lldb::addr_t(lldb::addr_t file_addr)> const & | link_address_callback | ||
) |
Definition at line 96 of file DWARFExpressionList.cpp.
References lldb_private::RangeData< B, S, T >::data, lldb_private::RangeDataVector< B, S, T, N, Compare >::GetEntryRef(), IsAlwaysValidSingleExpr(), lldb_private::DWARFExpression::LinkThreadLocalStorage(), m_dwarf_cu, m_exprs, and m_module_wp.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
bool DWARFExpressionList::MatchesOperand | ( | StackFrame & | frame, |
const Instruction::Operand & | operand | ||
) | const |
Definition at line 115 of file DWARFExpressionList.cpp.
References lldb_private::RangeData< B, S, T >::data, lldb_private::SymbolContext::function, lldb_private::Function::GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::RangeDataVector< B, S, T, N, Compare >::GetEntryAtIndex(), GetExpressionAtAddress(), lldb_private::Address::GetFileAddress(), lldb_private::StackFrame::GetFrameCodeAddressForSymbolication(), lldb_private::StackFrame::GetRegisterContext(), lldb_private::StackFrame::GetSymbolContext(), IsAlwaysValidSingleExpr(), LLDB_INVALID_ADDRESS, m_exprs, lldb_private::DWARFExpression::MatchesOperand(), and pc.
Referenced by lldb_private::DWARFExpression::MatchesOperand().
|
inline |
Definition at line 62 of file DWARFExpressionList.h.
References m_func_file_addr.
Referenced by lldb_private::npdb::SymbolFileNativePDB::CreateLocalVariable(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges(), and GetExprListFromAtLocation().
|
inline |
Definition at line 115 of file DWARFExpressionList.h.
References m_module_wp.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
|
inline |
Sort m_expressions.
Definition at line 60 of file DWARFExpressionList.h.
References m_exprs, and lldb_private::RangeDataVector< B, S, T, N, Compare >::Sort().
Referenced by lldb_private::DWARFExpression::ParseDWARFLocationList().
|
private |
The DWARF compile unit this expression belongs to.
It is used to evaluate values indexing into the .debug_addr section (e.g. DW_OP_GNU_addr_index, DW_OP_GNU_const_index)
Definition at line 146 of file DWARFExpressionList.h.
Referenced by ContainsThreadLocalStorage(), Evaluate(), and LinkThreadLocalStorage().
|
private |
Definition at line 138 of file DWARFExpressionList.h.
Referenced by AddExpression(), begin(), Clear(), ContainsThreadLocalStorage(), end(), Evaluate(), GetAlwaysValidExpr(), GetDescription(), GetExpressionAtAddress(), GetMutableExpressionAtAddress(), GetSize(), IsValid(), LinkThreadLocalStorage(), MatchesOperand(), and Sort().
|
private |
Definition at line 149 of file DWARFExpressionList.h.
Referenced by DumpLocations(), GetExpressionAtAddress(), GetFuncFileAddress(), GetMutableExpressionAtAddress(), and SetFuncFileAddress().
|
private |
Module which defined this expression.
Definition at line 141 of file DWARFExpressionList.h.
Referenced by Evaluate(), LinkThreadLocalStorage(), and SetModule().