summaryrefslogtreecommitdiff
path: root/gdb/dwarf2/loc.c
diff options
context:
space:
mode:
authorZoran Zaric <Zoran.Zaric@amd.com>2020-12-07 19:00:31 +0000
committerSimon Marchi <simon.marchi@polymtl.ca>2020-12-08 11:16:21 -0500
commit1127a49b3242844d45d90658c7bfa886cd742ef1 (patch)
treea304584cbadb93df024c5df62075c9b1f19a3d7c /gdb/dwarf2/loc.c
parentdab5aee6dc3a8b19d5058f7c1b24d632a78a7adf (diff)
downloadbinutils-gdb-users/zoran/allow-location-description-on-dwarf-stack.tar.gz
Add support for nested composite locationsusers/zoran/allow-location-description-on-dwarf-stack
After allowing a location description to be placed on a DWARF stack, in an effort to achieve a full composability of the DWARF expression, it is necessary to enable forming of a nested composite location descriptions. To be able do this, a new operation DW_OP_LLVM_piece_end needs to be introduced, along with some additional rules on the way how the composite location description is formed using the existing DW_OP_piece and DW_OP_bit_piece operations. These new rules are fully compatible with the composite forming rules from the DWARF 5 standard. More details on the new operation and added rules can be found here: https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html gdb/ChangeLog: * compile/compile-loc2c.c (compute_stack_depth_worker): Add new DW_OP_LLVM_piece_end operation support. * dwarf2/expr.c (class dwarf_value): Add copy constructor. (class dwarf_location): Add copy constructor. (class dwarf_undefined): Add copy constructor. (class dwarf_memory): Add copy constructor. (class dwarf_register): Add copy constructor. (class dwarf_implicit): Add copy constructor. (class dwarf_implicit_pointer): Add copy constructor. (class dwarf_composite): Add copy constructor. (read_from_location): Add composite completed check. (write_to_location): Add composite completed check. (read_value_contents_from_location): New function. (dwarf_entry_factory::copy_entry): New method. (rw_closure_value): Now calls read_value_contents_from_location function. (dwarf_expr_context::add_piece): Use new composite forming rules. (dwarf_expr_context::execute_stack_op): Add new DW_OP_LLVM_piece_end operation support. * dwarf2/loc.c (dwarf2_get_symbol_read_needs): Add new DW_OP_LLVM_piece_end operation support. include/ChangeLog: * dwarf2.def (DW_OP_DUP): Add new DW_OP_LLVM_piece_end enumeration. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-llvm-piece-end.exp: New test. Change-Id: Ib0b25e5de3f23df89d7d9e86aad56029c7d173df
Diffstat (limited to 'gdb/dwarf2/loc.c')
-rw-r--r--gdb/dwarf2/loc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 1a903ce1233..e98d6fb39d6 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -1832,6 +1832,7 @@ dwarf2_get_symbol_read_needs (gdb::array_view<const gdb_byte> expr,
case DW_OP_LLVM_offset:
case DW_OP_LLVM_bit_offset:
case DW_OP_LLVM_undefined:
+ case DW_OP_LLVM_piece_end:
break;
case DW_OP_form_tls_address: