25using namespace llvm::dwarf;
43 SectionList *section_list = module_sp ? module_sp->GetSectionList() :
nullptr;
47 for (
size_t i = 0; i < num_units; ++i) {
54 if (tag != DW_TAG_subprogram && tag != DW_TAG_variable)
63 if (tag == DW_TAG_subprogram) {
79 bool has_location =
false;
80 for (
size_t attr_idx = 0; attr_idx < attributes.
Size(); ++attr_idx) {
95 llvm::consumeError(file_addr.takeError());
99 Address addr(*file_addr, section_list);
120 const uint8_t op)
const {
121 if (op != llvm::dwarf::DW_OP_WASM_location)
125 const uint8_t wasm_op = data.
GetU8(&offset);
139 return offset - data_offset;
143 const llvm::DataExtractor &opcodes,
147 std::vector<Value> &stack)
const {
148 if (op != llvm::dwarf::DW_OP_WASM_location)
159 const uint8_t wasm_op = opcodes.getU8(&offset);
162 index = opcodes.getULEB128(&offset);
166 index = opcodes.getULEB128(&offset);
170 index = opcodes.getULEB128(&offset);
174 index = opcodes.getU32(&offset);
185 reg_ctx, reg_kind, reg_num, tmp);
191 stack.push_back(tmp);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG_ERROR(log, error,...)
A section + offset based address range class.
A section + offset based address class.
bool IsSectionOffset() const
Check if an address is section offset.
A uniqued constant string class.
"lldb/Expression/DWARFExpression.h" Encapsulates a DWARF location expression and interprets it.
llvm::Expected< lldb::addr_t > GetLocation_DW_OP_addr(const Delegate *dwarf_cu) const
Return the address specified by the first DW_OP_{addr, addrx, GNU_addr_index} in the operation stream...
static llvm::Error ReadRegisterValueAsScalar(RegisterContext *reg_ctx, lldb::RegisterKind reg_kind, uint32_t reg_num, Value &value)
A class that handles mangled names.
ConstString GetMangledName() const
Mangled name get accessor.
void SetMangledName(ConstString name)
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
ObjectFile * GetObjectFile() override
virtual void AddSymbols(Symtab &symtab)
Symbol * FindSymbolAtFileAddress(lldb::addr_t file_addr)
uint32_t AddSymbol(const Symbol &symbol)
dw_attr_t AttributeAtIndex(uint32_t i) const
bool ExtractFormValueAtIndex(uint32_t i, DWARFFormValue &form_value) const
DWARFAttributes GetAttributes(Recurse recurse=Recurse::yes) const
const DWARFDataExtractor & GetData() const
uint64_t GetAttributeValueAsAddress(const dw_attr_t attr, uint64_t fail_value) const
const char * GetMangledName(bool substitute_name_allowed=true) const
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
DWARFUnit * GetUnitAtIndex(size_t idx)
die_iterator_range dies()
SymbolFileDWARF(lldb::ObjectFileSP objfile_sp, SectionList *dwo_section_list)
DWARFDebugInfo & DebugInfo()
SymbolFileWasm(lldb::ObjectFileSP objfile_sp, SectionList *dwo_section_list)
void AddSymbols(Symtab &symtab) override
The Wasm "name" section stores only demangled names, so symbols parsed from it have no mangled name t...
lldb::offset_t GetVendorDWARFOpcodeSize(const DataExtractor &data, const lldb::offset_t data_offset, const uint8_t op) const override
~SymbolFileWasm() override
bool ParseVendorDWARFOpcode(uint8_t op, const llvm::DataExtractor &opcodes, lldb::offset_t &offset, RegisterContext *reg_ctx, lldb::RegisterKind reg_kind, std::vector< Value > &stack) const override
llvm::dwarf::Tag dw_tag_t
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_OFFSET
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
uint32_t GetWasmRegister(uint8_t tag, uint32_t index)
@ eWasmTagNotAWasmLocation
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
std::shared_ptr< lldb_private::Module > ModuleSP
RegisterKind
Register numbering types.