[Lldb-commits] [PATCH] D59004: [lldb] Fix DW_OP_addrx uses.
tamur created this revision. tamur added a project: LLDB. Herald added a subscriber: lldb-commits. DW_OP_GNU_addr_index has been renamed as DW_OP_addrx in the standard. clang produces DW_OP_addrx tags and with this change lldb starts to process them. Repository: rLLDB LLDB https://reviews.llvm.org/D59004 Files: lldb/source/Expression/DWARFExpression.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp Index: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp @@ -166,6 +166,7 @@ case DW_FORM_ref_sig8: llvm_unreachable("Unhandled atom form"); + case DW_FORM_addrx: case DW_FORM_string: case DW_FORM_block: case DW_FORM_block1: Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -681,6 +681,7 @@ return 1; switch (a_form) { case DW_FORM_addr: + case DW_FORM_addrx: case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_data2: Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -326,6 +326,7 @@ break; // signed or unsigned LEB 128 values + case DW_FORM_addrx: case DW_FORM_sdata: case DW_FORM_udata: case DW_FORM_ref_udata: @@ -456,6 +457,7 @@ case DW_AT_high_pc: if (form_value.Form() == DW_FORM_addr || + form_value.Form() == DW_FORM_addrx || form_value.Form() == DW_FORM_GNU_addr_index) { hi_pc = form_value.Address(); } else { @@ -1031,7 +1033,8 @@ if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr, check_specification_or_abstract_origin)) { dw_form_t form = form_value.Form(); -if (form == DW_FORM_addr || form == DW_FORM_GNU_addr_index) +if (form == DW_FORM_addr || form == DW_FORM_addrx || +form == DW_FORM_GNU_addr_index) return form_value.Address(); // DWARF4 can specify the hi_pc as an Index: lldb/source/Expression/DWARFExpression.cpp === --- lldb/source/Expression/DWARFExpression.cpp +++ lldb/source/Expression/DWARFExpression.cpp @@ -514,6 +514,10 @@ s->Printf("DW_OP_GNU_addr_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); break; +case DW_OP_addrx: + s->Printf("DW_OP_addrx(0x%" PRIx64 ")", +m_data.GetULEB128(&offset)); + break; case DW_OP_GNU_const_index: // 0xfc s->Printf("DW_OP_GNU_const_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); @@ -877,6 +881,7 @@ return 8; // All opcodes that have a single ULEB (signed or unsigned) argument + case DW_OP_addrx: // 0xa1 1 ULEB128 index case DW_OP_constu: // 0x10 1 ULEB128 constant case DW_OP_consts: // 0x11 1 SLEB128 constant case DW_OP_plus_uconst: // 0x23 1 ULEB128 addend @@ -957,7 +962,7 @@ return op_file_addr; else ++curr_op_addr_idx; -} else if (op == DW_OP_GNU_addr_index) { +} else if (op == DW_OP_GNU_addr_index || op == DW_OP_addrx) { uint64_t index = m_data.GetULEB128(&offset); if (curr_op_addr_idx == op_addr_idx) { if (!m_dwarf_cu) { @@ -2909,6 +2914,7 @@ // section with the base address specified by the DW_AT_addr_base attribute // and the 0 based index is the ULEB128 encoded index. //-- +case DW_OP_addrx: case DW_OP_GNU_addr_index: { if (!dwarf_cu) { if (error_ptr) @@ -3194,6 +3200,7 @@ case DW_OP_call_ref: size = dwarf_ref_size; break; + case DW_OP_addrx: case DW_OP_piece: case DW_OP_plus_uconst: case DW_OP_regx: ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D59004: [lldb] Fix DW_OP_addrx uses.
tamur updated this revision to Diff 189415. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59004/new/ https://reviews.llvm.org/D59004 Files: lldb/source/Expression/DWARFExpression.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp Index: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp @@ -166,6 +166,7 @@ case DW_FORM_ref_sig8: llvm_unreachable("Unhandled atom form"); + case DW_FORM_addrx: case DW_FORM_string: case DW_FORM_block: case DW_FORM_block1: Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -681,6 +681,7 @@ return 1; switch (a_form) { case DW_FORM_addr: + case DW_FORM_addrx: case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_data2: Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -326,6 +326,7 @@ break; // signed or unsigned LEB 128 values + case DW_FORM_addrx: case DW_FORM_sdata: case DW_FORM_udata: case DW_FORM_ref_udata: @@ -456,6 +457,7 @@ case DW_AT_high_pc: if (form_value.Form() == DW_FORM_addr || + form_value.Form() == DW_FORM_addrx || form_value.Form() == DW_FORM_GNU_addr_index) { hi_pc = form_value.Address(); } else { @@ -1031,7 +1033,8 @@ if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr, check_specification_or_abstract_origin)) { dw_form_t form = form_value.Form(); -if (form == DW_FORM_addr || form == DW_FORM_GNU_addr_index) +if (form == DW_FORM_addr || form == DW_FORM_addrx || +form == DW_FORM_GNU_addr_index) return form_value.Address(); // DWARF4 can specify the hi_pc as an Index: lldb/source/Expression/DWARFExpression.cpp === --- lldb/source/Expression/DWARFExpression.cpp +++ lldb/source/Expression/DWARFExpression.cpp @@ -514,6 +514,10 @@ s->Printf("DW_OP_GNU_addr_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); break; +case DW_OP_addrx: + s->Printf("DW_OP_addrx(0x%" PRIx64 ")", +m_data.GetULEB128(&offset)); + break; case DW_OP_GNU_const_index: // 0xfc s->Printf("DW_OP_GNU_const_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); @@ -877,6 +881,7 @@ return 8; // All opcodes that have a single ULEB (signed or unsigned) argument + case DW_OP_addrx: // 0xa1 1 ULEB128 index case DW_OP_constu: // 0x10 1 ULEB128 constant case DW_OP_consts: // 0x11 1 SLEB128 constant case DW_OP_plus_uconst: // 0x23 1 ULEB128 addend @@ -957,7 +962,7 @@ return op_file_addr; else ++curr_op_addr_idx; -} else if (op == DW_OP_GNU_addr_index) { +} else if (op == DW_OP_GNU_addr_index || op == DW_OP_addrx) { uint64_t index = m_data.GetULEB128(&offset); if (curr_op_addr_idx == op_addr_idx) { if (!m_dwarf_cu) { @@ -2902,13 +2907,14 @@ } break; //-- -// OPCODE: DW_OP_GNU_addr_index +// OPCODE: DW_OP_addrx (DW_OP_GNU_addr_index is the legacy name.) // OPERANDS: 1 // ULEB128: index to the .debug_addr section // DESCRIPTION: Pushes an address to the stack from the .debug_addr // section with the base address specified by the DW_AT_addr_base attribute // and the 0 based index is the ULEB128 encoded index. //-- +case DW_OP_addrx: case DW_OP_GNU_addr_index: { if (!dwarf_cu) { if (error_ptr) @@ -3194,6 +3200,7 @@ case DW_OP_call_ref: size = dwarf_ref_size; break; + case DW_OP_addrx: case DW_OP_piece: case DW_OP_plus_uconst: case DW_OP_regx: ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D59004: [lldb] Fix DW_OP_addrx uses.
tamur marked an inline comment as done. tamur added inline comments. Comment at: lldb/source/Expression/DWARFExpression.cpp:2910 //-- // OPCODE: DW_OP_GNU_addr_index // OPERANDS: 1 shafik wrote: > Should this comment be updated? Updated the comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59004/new/ https://reviews.llvm.org/D59004 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D59004: [lldb] Fix DW_OP_addrx uses.
tamur updated this revision to Diff 189423. tamur added a comment. Herald added a reviewer: serge-sans-paille. Added a test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59004/new/ https://reviews.llvm.org/D59004 Files: lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py lldb/source/Expression/DWARFExpression.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp Index: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp @@ -166,6 +166,7 @@ case DW_FORM_ref_sig8: llvm_unreachable("Unhandled atom form"); + case DW_FORM_addrx: case DW_FORM_string: case DW_FORM_block: case DW_FORM_block1: Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -681,6 +681,7 @@ return 1; switch (a_form) { case DW_FORM_addr: + case DW_FORM_addrx: case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_data2: Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -326,6 +326,7 @@ break; // signed or unsigned LEB 128 values + case DW_FORM_addrx: case DW_FORM_sdata: case DW_FORM_udata: case DW_FORM_ref_udata: @@ -456,6 +457,7 @@ case DW_AT_high_pc: if (form_value.Form() == DW_FORM_addr || + form_value.Form() == DW_FORM_addrx || form_value.Form() == DW_FORM_GNU_addr_index) { hi_pc = form_value.Address(); } else { @@ -1031,7 +1033,8 @@ if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr, check_specification_or_abstract_origin)) { dw_form_t form = form_value.Form(); -if (form == DW_FORM_addr || form == DW_FORM_GNU_addr_index) +if (form == DW_FORM_addr || form == DW_FORM_addrx || +form == DW_FORM_GNU_addr_index) return form_value.Address(); // DWARF4 can specify the hi_pc as an Index: lldb/source/Expression/DWARFExpression.cpp === --- lldb/source/Expression/DWARFExpression.cpp +++ lldb/source/Expression/DWARFExpression.cpp @@ -514,6 +514,10 @@ s->Printf("DW_OP_GNU_addr_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); break; +case DW_OP_addrx: + s->Printf("DW_OP_addrx(0x%" PRIx64 ")", +m_data.GetULEB128(&offset)); + break; case DW_OP_GNU_const_index: // 0xfc s->Printf("DW_OP_GNU_const_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); @@ -877,6 +881,7 @@ return 8; // All opcodes that have a single ULEB (signed or unsigned) argument + case DW_OP_addrx: // 0xa1 1 ULEB128 index case DW_OP_constu: // 0x10 1 ULEB128 constant case DW_OP_consts: // 0x11 1 SLEB128 constant case DW_OP_plus_uconst: // 0x23 1 ULEB128 addend @@ -957,7 +962,7 @@ return op_file_addr; else ++curr_op_addr_idx; -} else if (op == DW_OP_GNU_addr_index) { +} else if (op == DW_OP_GNU_addr_index || op == DW_OP_addrx) { uint64_t index = m_data.GetULEB128(&offset); if (curr_op_addr_idx == op_addr_idx) { if (!m_dwarf_cu) { @@ -2902,13 +2907,14 @@ } break; //-- -// OPCODE: DW_OP_GNU_addr_index +// OPCODE: DW_OP_addrx (DW_OP_GNU_addr_index is the legacy name.) // OPERANDS: 1 // ULEB128: index to the .debug_addr section // DESCRIPTION: Pushes an address to the stack from the .debug_addr // section with the base address specified by the DW_AT_addr_base attribute // and the 0 based index is the ULEB128 encoded index. //-- +case DW_OP_addrx: case DW_OP_GNU_addr_index: { if (!dwarf_cu) { if (error_ptr) @@ -3194,6 +3200,7 @@ case DW_OP_call_ref: size = dwarf_ref_size; break; + case DW_OP_addrx: case DW_OP_piece: case DW_OP_plus_uconst: case DW_OP_regx: Index: lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py === --- lldb/packages/
[Lldb-commits] [PATCH] D59004: [lldb] Fix DW_OP_addrx uses.
tamur updated this revision to Diff 189652. tamur added a comment. Herald added a subscriber: jdoerfert. Discarded changes to the unit test and added a lit test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59004/new/ https://reviews.llvm.org/D59004 Files: lldb/lit/SymbolFile/DWARF/dwarf5_locations.s lldb/source/Expression/DWARFExpression.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp Index: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp @@ -166,6 +166,7 @@ case DW_FORM_ref_sig8: llvm_unreachable("Unhandled atom form"); + case DW_FORM_addrx: case DW_FORM_string: case DW_FORM_block: case DW_FORM_block1: Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -681,6 +681,7 @@ return 1; switch (a_form) { case DW_FORM_addr: + case DW_FORM_addrx: case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_data2: Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -326,6 +326,7 @@ break; // signed or unsigned LEB 128 values + case DW_FORM_addrx: case DW_FORM_sdata: case DW_FORM_udata: case DW_FORM_ref_udata: @@ -456,6 +457,7 @@ case DW_AT_high_pc: if (form_value.Form() == DW_FORM_addr || + form_value.Form() == DW_FORM_addrx || form_value.Form() == DW_FORM_GNU_addr_index) { hi_pc = form_value.Address(); } else { @@ -1031,7 +1033,8 @@ if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr, check_specification_or_abstract_origin)) { dw_form_t form = form_value.Form(); -if (form == DW_FORM_addr || form == DW_FORM_GNU_addr_index) +if (form == DW_FORM_addr || form == DW_FORM_addrx || +form == DW_FORM_GNU_addr_index) return form_value.Address(); // DWARF4 can specify the hi_pc as an Index: lldb/source/Expression/DWARFExpression.cpp === --- lldb/source/Expression/DWARFExpression.cpp +++ lldb/source/Expression/DWARFExpression.cpp @@ -514,6 +514,10 @@ s->Printf("DW_OP_GNU_addr_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); break; +case DW_OP_addrx: + s->Printf("DW_OP_addrx(0x%" PRIx64 ")", +m_data.GetULEB128(&offset)); + break; case DW_OP_GNU_const_index: // 0xfc s->Printf("DW_OP_GNU_const_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); @@ -877,6 +881,7 @@ return 8; // All opcodes that have a single ULEB (signed or unsigned) argument + case DW_OP_addrx: // 0xa1 1 ULEB128 index case DW_OP_constu: // 0x10 1 ULEB128 constant case DW_OP_consts: // 0x11 1 SLEB128 constant case DW_OP_plus_uconst: // 0x23 1 ULEB128 addend @@ -957,7 +962,7 @@ return op_file_addr; else ++curr_op_addr_idx; -} else if (op == DW_OP_GNU_addr_index) { +} else if (op == DW_OP_GNU_addr_index || op == DW_OP_addrx) { uint64_t index = m_data.GetULEB128(&offset); if (curr_op_addr_idx == op_addr_idx) { if (!m_dwarf_cu) { @@ -2902,13 +2907,14 @@ } break; //-- -// OPCODE: DW_OP_GNU_addr_index +// OPCODE: DW_OP_addrx (DW_OP_GNU_addr_index is the legacy name.) // OPERANDS: 1 // ULEB128: index to the .debug_addr section // DESCRIPTION: Pushes an address to the stack from the .debug_addr // section with the base address specified by the DW_AT_addr_base attribute // and the 0 based index is the ULEB128 encoded index. //-- +case DW_OP_addrx: case DW_OP_GNU_addr_index: { if (!dwarf_cu) { if (error_ptr) @@ -3194,6 +3200,7 @@ case DW_OP_call_ref: size = dwarf_ref_size; break; + case DW_OP_addrx: case DW_OP_piece: case DW_OP_plus_uconst: case DW_OP_regx: Index: lldb/lit/SymbolFile/DWARF/dwarf5_locations.s === --- /dev/null +++ lldb/lit/Sy
[Lldb-commits] [PATCH] D59004: [lldb] Fix DW_OP_addrx uses.
This revision was automatically updated to reflect the committed changes. Closed by commit rL355629: [lldb] Fix DW_OP_addrx uses. (authored by tamur, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D59004?vs=189652&id=189761#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59004/new/ https://reviews.llvm.org/D59004 Files: lldb/trunk/lit/SymbolFile/DWARF/dwarf5_locations.s lldb/trunk/source/Expression/DWARFExpression.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp === --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -326,6 +326,7 @@ break; // signed or unsigned LEB 128 values + case DW_FORM_addrx: case DW_FORM_sdata: case DW_FORM_udata: case DW_FORM_ref_udata: @@ -456,6 +457,7 @@ case DW_AT_high_pc: if (form_value.Form() == DW_FORM_addr || + form_value.Form() == DW_FORM_addrx || form_value.Form() == DW_FORM_GNU_addr_index) { hi_pc = form_value.Address(); } else { @@ -1031,7 +1033,8 @@ if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr, check_specification_or_abstract_origin)) { dw_form_t form = form_value.Form(); -if (form == DW_FORM_addr || form == DW_FORM_GNU_addr_index) +if (form == DW_FORM_addr || form == DW_FORM_addrx || +form == DW_FORM_GNU_addr_index) return form_value.Address(); // DWARF4 can specify the hi_pc as an Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp === --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -681,6 +681,7 @@ return 1; switch (a_form) { case DW_FORM_addr: + case DW_FORM_addrx: case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_data2: Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp === --- lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp @@ -166,6 +166,7 @@ case DW_FORM_ref_sig8: llvm_unreachable("Unhandled atom form"); + case DW_FORM_addrx: case DW_FORM_string: case DW_FORM_block: case DW_FORM_block1: Index: lldb/trunk/source/Expression/DWARFExpression.cpp === --- lldb/trunk/source/Expression/DWARFExpression.cpp +++ lldb/trunk/source/Expression/DWARFExpression.cpp @@ -514,6 +514,10 @@ s->Printf("DW_OP_GNU_addr_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); break; +case DW_OP_addrx: + s->Printf("DW_OP_addrx(0x%" PRIx64 ")", +m_data.GetULEB128(&offset)); + break; case DW_OP_GNU_const_index: // 0xfc s->Printf("DW_OP_GNU_const_index(0x%" PRIx64 ")", m_data.GetULEB128(&offset)); @@ -877,6 +881,7 @@ return 8; // All opcodes that have a single ULEB (signed or unsigned) argument + case DW_OP_addrx: // 0xa1 1 ULEB128 index case DW_OP_constu: // 0x10 1 ULEB128 constant case DW_OP_consts: // 0x11 1 SLEB128 constant case DW_OP_plus_uconst: // 0x23 1 ULEB128 addend @@ -957,7 +962,7 @@ return op_file_addr; else ++curr_op_addr_idx; -} else if (op == DW_OP_GNU_addr_index) { +} else if (op == DW_OP_GNU_addr_index || op == DW_OP_addrx) { uint64_t index = m_data.GetULEB128(&offset); if (curr_op_addr_idx == op_addr_idx) { if (!m_dwarf_cu) { @@ -2902,13 +2907,14 @@ } break; //-- -// OPCODE: DW_OP_GNU_addr_index +// OPCODE: DW_OP_addrx (DW_OP_GNU_addr_index is the legacy name.) // OPERANDS: 1 // ULEB128: index to the .debug_addr section // DESCRIPTION: Pushes an address to the stack from the .debug_addr // section with the base address specified by the DW_AT_addr_base attribute // and the 0 based index is the ULEB128 encoded index. //-- +case DW_OP_addrx: case DW_OP_GNU_addr_index: { if (!dwarf_cu) { if (error_ptr) @@ -3194,6 +3200,7 @@ case DW_OP_call_ref: size = dwarf_ref_size; b