LLDB mainline
lldb_private::DWARFExpressionList Class Reference

"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< DWARFExpressionEntryGetExpressionEntryAtAddress (lldb::addr_t func_load_addr, lldb::addr_t load_addr) const
 Returns a DWARFExpressionEntry whose file_range contains the given load‐address.
const DWARFExpressionGetExpressionAtAddress (lldb::addr_t func_load_addr, lldb::addr_t load_addr) const
const DWARFExpressionGetAlwaysValidExpr () const
DWARFExpressionGetMutableExpressionAtAddress (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< ValueEvaluate (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::Delegatem_dwarf_cu = nullptr
 The DWARF compile unit this expression belongs to.
lldb::addr_t m_func_file_addr = LLDB_INVALID_ADDRESS

Detailed Description

"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.

Member Typedef Documentation

◆ const_iterator

◆ Entry

◆ ExprVec

Initial value:

Definition at line 139 of file DWARFExpressionList.h.

Constructor & Destructor Documentation

◆ DWARFExpressionList() [1/3]

lldb_private::DWARFExpressionList::DWARFExpressionList ( )
default

◆ DWARFExpressionList() [2/3]

lldb_private::DWARFExpressionList::DWARFExpressionList ( lldb::ModuleSP module_sp,
const DWARFExpression::Delegate * dwarf_cu,
lldb::addr_t func_file_addr )
inline

Definition at line 27 of file DWARFExpressionList.h.

References m_dwarf_cu, m_func_file_addr, and m_module_wp.

◆ DWARFExpressionList() [3/3]

lldb_private::DWARFExpressionList::DWARFExpressionList ( lldb::ModuleSP module_sp,
DWARFExpression expr,
const DWARFExpression::Delegate * dwarf_cu )
inline

Definition at line 33 of file DWARFExpressionList.h.

References AddExpression(), LLDB_INVALID_ADDRESS, m_dwarf_cu, and m_module_wp.

Member Function Documentation

◆ AddExpression()

◆ begin()

const_iterator lldb_private::DWARFExpressionList::begin ( ) const
inlineprivate

Definition at line 158 of file DWARFExpressionList.h.

References m_exprs.

◆ Clear()

void lldb_private::DWARFExpressionList::Clear ( )
inline

◆ ContainsAddress()

bool DWARFExpressionList::ContainsAddress ( lldb::addr_t func_load_addr,
lldb::addr_t addr ) const

Search for a load address in the dwarf location list.

Parameters
[in]func_load_addrThe actual address of the function containing this location list.
[in]addrThe address to resolve.
Returns
True if IsLocationList() is true and the address was found; false otherwise.

Definition at line 50 of file DWARFExpressionList.cpp.

References GetExpressionAtAddress(), and IsAlwaysValidSingleExpr().

◆ ContainsThreadLocalStorage()

◆ DumpLocations()

bool DWARFExpressionList::DumpLocations ( Stream * s,
lldb::DescriptionLevel level,
lldb::addr_t func_load_addr,
lldb::addr_t file_addr,
ABI * abi ) const

◆ end()

const_iterator lldb_private::DWARFExpressionList::end ( ) const
inlineprivate

Definition at line 159 of file DWARFExpressionList.h.

References m_exprs.

Referenced by AddExpression().

◆ Evaluate()

◆ GetAlwaysValidExpr()

◆ GetDescription()

◆ GetExpressionAtAddress()

const DWARFExpression * DWARFExpressionList::GetExpressionAtAddress ( lldb::addr_t func_load_addr,
lldb::addr_t load_addr ) const

◆ GetExpressionData()

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().

◆ GetExpressionEntryAtAddress()

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().

◆ GetFuncFileAddress()

lldb::addr_t lldb_private::DWARFExpressionList::GetFuncFileAddress ( )
inline

Definition at line 61 of file DWARFExpressionList.h.

References m_func_file_addr.

◆ GetMutableExpressionAtAddress()

◆ GetSize()

size_t lldb_private::DWARFExpressionList::GetSize ( ) const
inline

Definition at line 87 of file DWARFExpressionList.h.

References m_exprs.

◆ IsAlwaysValidSingleExpr()

◆ IsValid()

bool lldb_private::DWARFExpressionList::IsValid ( ) const
inline

◆ LinkThreadLocalStorage()

bool DWARFExpressionList::LinkThreadLocalStorage ( lldb::ModuleSP new_module_sp,
std::function< lldb::addr_t(lldb::addr_t file_addr)> const & link_address_callback )

◆ MatchesOperand()

◆ SetFuncFileAddress()

void lldb_private::DWARFExpressionList::SetFuncFileAddress ( lldb::addr_t func_file_addr)
inline

◆ SetModule()

void lldb_private::DWARFExpressionList::SetModule ( const lldb::ModuleSP & module)
inline

◆ Sort()

void lldb_private::DWARFExpressionList::Sort ( )
inline

Sort m_expressions.

Definition at line 55 of file DWARFExpressionList.h.

References m_exprs.

Referenced by lldb_private::plugin::dwarf::DWARFUnit::ParseDWARFLocationList().

Member Data Documentation

◆ m_dwarf_cu

const DWARFExpression::Delegate* lldb_private::DWARFExpressionList::m_dwarf_cu = nullptr
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().

◆ m_exprs

◆ m_func_file_addr

◆ m_module_wp

lldb::ModuleWP lldb_private::DWARFExpressionList::m_module_wp
private

Module which defined this expression.

Definition at line 147 of file DWARFExpressionList.h.

Referenced by DWARFExpressionList(), DWARFExpressionList(), Evaluate(), LinkThreadLocalStorage(), and SetModule().


The documentation for this class was generated from the following files: