LLDB mainline
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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
 

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 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 = 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::DWARFUnitm_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 28 of file DWARFExpressionList.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 151 of file DWARFExpressionList.h.

◆ Entry

Definition at line 135 of file DWARFExpressionList.h.

◆ ExprVec

Definition at line 133 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 plugin::dwarf::DWARFUnit dwarf_cu,
lldb::addr_t  func_file_addr 
)
inline

Definition at line 32 of file DWARFExpressionList.h.

◆ DWARFExpressionList() [3/3]

lldb_private::DWARFExpressionList::DWARFExpressionList ( lldb::ModuleSP  module_sp,
DWARFExpression  expr,
const plugin::dwarf::DWARFUnit dwarf_cu 
)
inline

Definition at line 38 of file DWARFExpressionList.h.

References AddExpression(), and LLDB_INVALID_ADDRESS.

Member Function Documentation

◆ AddExpression()

bool DWARFExpressionList::AddExpression ( lldb::addr_t  base,
lldb::addr_t  end,
DWARFExpression  expr 
)

◆ begin()

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

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

Referenced by lldb_private::Variable::LocationIsValidForAddress(), and lldb_private::Variable::LocationIsValidForFrame().

◆ ContainsThreadLocalStorage()

bool DWARFExpressionList::ContainsThreadLocalStorage ( ) const

◆ 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

◆ Evaluate()

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

◆ GetAlwaysValidExpr()

const DWARFExpression * DWARFExpressionList::GetAlwaysValidExpr ( ) const

◆ GetDescription()

void DWARFExpressionList::GetDescription ( Stream s,
lldb::DescriptionLevel  level,
ABI abi 
) const

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

◆ GetFuncFileAddress()

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

Definition at line 66 of file DWARFExpressionList.h.

References m_func_file_addr.

◆ GetMutableExpressionAtAddress()

DWARFExpression * DWARFExpressionList::GetMutableExpressionAtAddress ( lldb::addr_t  func_load_addr = LLDB_INVALID_ADDRESS,
lldb::addr_t  load_addr = 0 
)

◆ GetSize()

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

◆ IsAlwaysValidSingleExpr()

bool DWARFExpressionList::IsAlwaysValidSingleExpr ( ) const

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

bool DWARFExpressionList::MatchesOperand ( StackFrame frame,
const Instruction::Operand operand 
) const

◆ 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

Member Data Documentation

◆ m_dwarf_cu

const plugin::dwarf::DWARFUnit* 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 146 of file DWARFExpressionList.h.

Referenced by ContainsThreadLocalStorage(), Evaluate(), and LinkThreadLocalStorage().

◆ m_exprs

ExprVec lldb_private::DWARFExpressionList::m_exprs
private

◆ m_func_file_addr

lldb::addr_t lldb_private::DWARFExpressionList::m_func_file_addr = LLDB_INVALID_ADDRESS
private

◆ m_module_wp

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

Module which defined this expression.

Definition at line 141 of file DWARFExpressionList.h.

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


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