14#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
15#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
46 return expr->GetExpressionData(data);
99 &link_address_callback) {
146 llvm::ListSeparator separator;
148 expr->DumpLocation(s, level, abi);
151 for (
const Entry &entry : *
this) {
155 (file_addr < load_base || file_addr >= load_end))
157 const auto &expr = entry.
data;
159 expr.GetExpressionData(data);
164 os << llvm::format_hex(load_base, 2 + 2 * addr_size);
166 os << llvm::format_hex(load_end, 2 + 2 * addr_size);
168 expr.DumpLocation(s, level, abi);
183 os << llvm::format(
"0x%8.8" PRIx64
": ", 0);
184 for (
const Entry &entry : *
this) {
185 const auto &expr = entry.
data;
187 expr.GetExpressionData(data);
192 llvm::DWARFFormValue::dumpAddress(os, addr_size, entry.
GetRangeBase());
194 llvm::DWARFFormValue::dumpAddress(os, addr_size, entry.
GetRangeEnd());
196 expr.DumpLocation(s, level, abi);
203 const Value *object_address_ptr)
const {
217 return llvm::createStringError(
"no frame");
220 return llvm::createStringError(
"no register context");
221 reg_ctx_sp->GetPCForSymbolication(
pc);
225 return llvm::createStringError(
"Invalid PC in frame.");
231 return llvm::createStringError(
"variable not available");
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
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.
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)
const plugin::dwarf::DWARFUnit * m_dwarf_cu
The DWARF compile unit this expression belongs to.
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.
static llvm::Expected< Value > Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::ModuleSP module_sp, const DataExtractor &opcodes, const plugin::dwarf::DWARFUnit *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 LinkThreadLocalStorage(const plugin::dwarf::DWARFUnit *dwarf_cu, std::function< lldb::addr_t(lldb::addr_t file_addr)> const &link_address_callback)
bool GetExpressionData(DataExtractor &data) const
bool ContainsThreadLocalStorage(const plugin::dwarf::DWARFUnit *dwarf_cu) const
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).
Entry & GetEntryRef(size_t i)
uint32_t FindEntryIndexThatContains(B addr) const
const Entry * GetEntryAtIndex(size_t i) const
Entry * GetMutableEntryAtIndex(size_t i)
void Append(const Entry &entry)
bool GetPCForSymbolication(Address &address)
Get an address suitable for symbolication.
This base class provides an interface to stack frames.
lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
Address GetFrameCodeAddressForSymbolication()
Get the current code Address suitable for symbolication, may not be the same as GetFrameCodeAddress()...
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.
BaseType GetRangeBase() const
BaseType GetRangeEnd() const