14#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
15#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
27 const auto *expr =
m_exprs.GetEntryAtIndex(0);
46 return expr->GetExpressionData(data);
57std::optional<DWARFExpressionList::DWARFExpressionEntry>
69 if (load_addr < func_load_addr)
79 if (
const auto *entry =
m_exprs.FindEntryThatContains(file_pc)) {
81 entry->GetRangeEnd() - entry->GetRangeBase());
97 uint32_t index =
m_exprs.FindEntryIndexThatContains(addr);
100 return &
m_exprs.GetEntryAtIndex(index)->data;
107 return &
m_exprs.GetMutableEntryAtIndex(0)->data;
111 uint32_t index =
m_exprs.FindEntryIndexThatContains(addr);
114 return &
m_exprs.GetMutableEntryAtIndex(index)->data;
131 &link_address_callback) {
155 expr = &
m_exprs.GetEntryAtIndex(0)->data;
178 llvm::ListSeparator separator;
180 expr->DumpLocation(s, level, abi);
183 for (
const Entry &entry : *
this) {
187 (file_addr < load_base || file_addr >= load_end))
189 const auto &expr = entry.
data;
191 expr.GetExpressionData(data);
196 os << llvm::format_hex(load_base, 2 + 2 * addr_size);
198 os << llvm::format_hex(load_end, 2 + 2 * addr_size);
200 expr.DumpLocation(s, level, abi);
212 m_exprs.Back()->data.DumpLocation(s, level, abi);
215 os << llvm::format(
"0x%8.8" PRIx64
": ", 0);
216 for (
const Entry &entry : *
this) {
217 const auto &expr = entry.
data;
219 expr.GetExpressionData(data);
224 llvm::DWARFFormValue::dumpAddress(os, addr_size, entry.
GetRangeBase());
226 llvm::DWARFFormValue::dumpAddress(os, addr_size, entry.
GetRangeEnd());
228 expr.DumpLocation(s, level, abi);
235 const Value *object_address_ptr)
const {
249 return llvm::createStringError(
"no frame");
252 return llvm::createStringError(
"no register context");
253 reg_ctx_sp->GetPCForSymbolication(
pc);
257 return llvm::createStringError(
"invalid PC in frame");
263 return llvm::createStringError(
"variable not available");
A section + offset based address range class.
A section + offset based address class.
lldb::addr_t GetFileAddress() const
Get the file address.
bool IsAlwaysValidSingleExpr() const
bool AddExpression(lldb::addr_t base, lldb::addr_t end, DWARFExpression expr)
const DWARFExpression * GetExpressionAtAddress(lldb::addr_t func_load_addr, lldb::addr_t load_addr) const
const DWARFExpression::Delegate * m_dwarf_cu
The DWARF compile unit this expression belongs to.
void GetDescription(Stream *s, lldb::DescriptionLevel level, ABI *abi) const
Dump all locaitons with each separated by new line.
bool MatchesOperand(StackFrame &frame, const Instruction::Operand &operand) const
const_iterator end() const
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
bool ContainsThreadLocalStorage() const
const DWARFExpression * GetAlwaysValidExpr() const
lldb::addr_t m_func_file_addr
lldb::ModuleWP m_module_wp
Module which defined this expression.
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.
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.
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.
bool LinkThreadLocalStorage(lldb::ModuleSP new_module_sp, std::function< lldb::addr_t(lldb::addr_t file_addr)> const &link_address_callback)
bool ContainsAddress(lldb::addr_t func_load_addr, lldb::addr_t addr) const
Search for a load address in the dwarf location list.
DWARFExpression * GetMutableExpressionAtAddress(lldb::addr_t func_load_addr=LLDB_INVALID_ADDRESS, lldb::addr_t load_addr=0)
"lldb/Expression/DWARFExpression.h" Encapsulates a DWARF location expression and interprets it.
bool GetExpressionData(DataExtractor &data) const
static llvm::Expected< Value > Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::ModuleSP module_sp, const DataExtractor &opcodes, const Delegate *dwarf_cu, const lldb::RegisterKind reg_set, const Value *initial_value_ptr, const Value *object_address_ptr)
Evaluate a DWARF location expression in a particular context.
bool ContainsThreadLocalStorage(const Delegate *dwarf_cu) const
bool LinkThreadLocalStorage(const Delegate *dwarf_cu, std::function< lldb::addr_t(lldb::addr_t file_addr)> const &link_address_callback)
bool MatchesOperand(StackFrame &frame, const Instruction::Operand &op) const
lldb::RegisterKind GetRegisterKind() const
Return the call-frame-info style register kind.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Target * GetTargetPtr() const
Returns a pointer to the target object.
const Address & GetAddress() const
Return the address of the function (its entry point).
bool GetPCForSymbolication(Address &address)
Get an address suitable for symbolication.
This base class provides an interface to stack frames.
virtual lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
virtual Address GetFrameCodeAddressForSymbolication()
Get the current code Address suitable for symbolication, may not be the same as GetFrameCodeAddress()...
virtual const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
A stream class that can stream formatted output to a file.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
unsigned GetIndentLevel() const
Get the current indentation level.
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
std::shared_ptr< lldb_private::Module > ModuleSP
RegisterKind
Register numbering types.
Represents an entry in the DWARFExpressionList with all needed metadata.
BaseType GetRangeBase() const
BaseType GetRangeEnd() const