| 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 | 
| struct | DWARFExpressionEntry | 
| Represents an entry in the DWARFExpressionList with all needed metadata.  More... | |
| Public Member Functions | |
| DWARFExpressionList ()=default | |
| DWARFExpressionList (lldb::ModuleSP module_sp, const DWARFExpression::Delegate *dwarf_cu, lldb::addr_t func_file_addr) | |
| DWARFExpressionList (lldb::ModuleSP module_sp, DWARFExpression expr, const DWARFExpression::Delegate *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 () | 
| std::optional< DWARFExpressionEntry > | GetExpressionEntryAtAddress (lldb::addr_t func_load_addr, lldb::addr_t load_addr) const | 
| Returns a DWARFExpressionEntry whose file_range contains the given load‐address. | |
| 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 | 
| 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 DWARFExpression::Delegate * | 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 23 of file DWARFExpressionList.h.
| 
 | private | 
Definition at line 157 of file DWARFExpressionList.h.
| 
 | private | 
Definition at line 141 of file DWARFExpressionList.h.
| 
 | private | 
Definition at line 139 of file DWARFExpressionList.h.
| 
 | default | 
| 
 | inline | 
Definition at line 27 of file DWARFExpressionList.h.
References m_dwarf_cu, m_func_file_addr, and m_module_wp.
| 
 | inline | 
Definition at line 33 of file DWARFExpressionList.h.
References AddExpression(), LLDB_INVALID_ADDRESS, m_dwarf_cu, and m_module_wp.
| bool DWARFExpressionList::AddExpression | ( | lldb::addr_t | base, | 
| lldb::addr_t | end, | ||
| DWARFExpression | expr ) | 
Definition at line 33 of file DWARFExpressionList.cpp.
References end(), IsAlwaysValidSingleExpr(), and m_exprs.
Referenced by DWARFExpressionList(), lldb_private::npdb::GetVariableLocationInfo(), and lldb_private::plugin::dwarf::DWARFUnit::ParseDWARFLocationList().
| 
 | inlineprivate | 
Definition at line 158 of file DWARFExpressionList.h.
References m_exprs.
| 
 | inline | 
Definition at line 42 of file DWARFExpressionList.h.
References m_exprs.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::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().
| bool DWARFExpressionList::ContainsThreadLocalStorage | ( | ) | const | 
Definition at line 117 of file DWARFExpressionList.cpp.
References lldb_private::DWARFExpression::ContainsThreadLocalStorage(), 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 173 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.
| 
 | inlineprivate | 
Definition at line 159 of file DWARFExpressionList.h.
References 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 232 of file DWARFExpressionList.cpp.
References 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::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_INVALID_ADDRESS, and m_exprs.
Referenced by DumpLocations(), GetExpressionAtAddress(), GetExpressionEntryAtAddress(), 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 207 of file DWARFExpressionList.cpp.
References lldb_private::Stream::AsRawOstream(), 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.
| const DWARFExpression * DWARFExpressionList::GetExpressionAtAddress | ( | lldb::addr_t | func_load_addr, | 
| lldb::addr_t | load_addr ) const | 
Definition at line 90 of file DWARFExpressionList.cpp.
References GetAlwaysValidExpr(), 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().
| std::optional< DWARFExpressionList::DWARFExpressionEntry > DWARFExpressionList::GetExpressionEntryAtAddress | ( | lldb::addr_t | func_load_addr, | 
| lldb::addr_t | load_addr ) const | 
Returns a DWARFExpressionEntry whose file_range contains the given load‐address.
func_load_addr is the load‐address of the function start; load_addr is the full runtime PC. On success, expr is non-null.
Definition at line 58 of file DWARFExpressionList.cpp.
References GetAlwaysValidExpr(), LLDB_INVALID_ADDRESS, m_exprs, and m_func_file_addr.
Referenced by lldb_private::VariableAnnotator::annotate().
| 
 | inline | 
Definition at line 61 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 104 of file DWARFExpressionList.cpp.
References 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 87 of file DWARFExpressionList.h.
References m_exprs.
| bool DWARFExpressionList::IsAlwaysValidSingleExpr | ( | ) | const | 
Definition at line 20 of file DWARFExpressionList.cpp.
References GetAlwaysValidExpr().
Referenced by AddExpression(), ContainsAddress(), ContainsThreadLocalStorage(), Evaluate(), GetDescription(), GetMutableExpressionAtAddress(), LinkThreadLocalStorage(), MatchesOperand(), and lldb_private::ValueObjectVariable::UpdateValue().
| 
 | inline | 
Return true if the location expression contains data.
Definition at line 40 of file DWARFExpressionList.h.
References m_exprs.
Referenced by lldb_private::VariableAnnotator::annotate(), lldb_private::npdb::SymbolFileNativePDB::CreateLocalVariable(), 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 128 of file DWARFExpressionList.cpp.
References 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 147 of file DWARFExpressionList.cpp.
References lldb_private::SymbolContext::function, lldb_private::Function::GetAddress(), 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 57 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 121 of file DWARFExpressionList.h.
References m_module_wp.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
| 
 | inline | 
Sort m_expressions.
Definition at line 55 of file DWARFExpressionList.h.
References m_exprs.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::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 152 of file DWARFExpressionList.h.
Referenced by ContainsThreadLocalStorage(), DWARFExpressionList(), DWARFExpressionList(), Evaluate(), and LinkThreadLocalStorage().
| 
 | private | 
Definition at line 144 of file DWARFExpressionList.h.
Referenced by AddExpression(), begin(), Clear(), ContainsThreadLocalStorage(), end(), Evaluate(), GetAlwaysValidExpr(), GetDescription(), GetExpressionAtAddress(), GetExpressionEntryAtAddress(), GetMutableExpressionAtAddress(), GetSize(), IsValid(), LinkThreadLocalStorage(), MatchesOperand(), and Sort().
| 
 | private | 
Definition at line 155 of file DWARFExpressionList.h.
Referenced by DumpLocations(), DWARFExpressionList(), GetExpressionAtAddress(), GetExpressionEntryAtAddress(), GetFuncFileAddress(), GetMutableExpressionAtAddress(), and SetFuncFileAddress().
| 
 | private | 
Module which defined this expression.
Definition at line 147 of file DWARFExpressionList.h.
Referenced by DWARFExpressionList(), DWARFExpressionList(), Evaluate(), LinkThreadLocalStorage(), and SetModule().