aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-12-10 17:17:29 +0000
committerTom Tromey <tromey@redhat.com>2012-12-10 17:17:29 +0000
commit8b9737bf8cca3d3f999bb48a27019933f2138c2c (patch)
treebaeba3860356f90c0986f90733137348d482e61c /gdb/dwarf2read.c
parent93eed41f8ee40080a4e5f21fe7e950e5f34534ae (diff)
downloadgdb-8b9737bf8cca3d3f999bb48a27019933f2138c2c.zip
gdb-8b9737bf8cca3d3f999bb48a27019933f2138c2c.tar.gz
gdb-8b9737bf8cca3d3f999bb48a27019933f2138c2c.tar.bz2
* dwarf2read.c (dwarf2_fetch_die_loc_sect_off): New function.
(dwarf2_fetch_die_loc_cu_off): Rename from dwarf2_fetch_die_location_block. Rewrite to use dwarf2_fetch_die_loc_sect_off. * dwarf2loc.h (dwarf2_fetch_die_loc_sect_off): Declare. (dwarf2_fetch_die_loc_cu_off): Rename. * dwarf2loc.c (indirect_pieced_value): Use dwarf2_fetch_die_loc_sect_off. * dwarf2expr.h (struct dwarf_expr_context) <len, data>: Update comment. (struct dwarf_expr_piece) <v.ptr.die>: Now a sect_offset. * dwarf2expr.c (add_piece): Update. (execute_stack_op) <DW_OP_GNU_implicit_pointer>: Update comment. testsuite * gdb.dwarf2/implptr-64bit.exp: Run tests with two CUs as well. (test): Add "two_cu" argument. * gdb.dwarf2/implptr-64bit.S: Move subprogram later; use ref_addr for types; allow two CUs.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6eea17e..2168c69 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -17334,12 +17334,11 @@ follow_die_ref (struct die_info *src_die, struct attribute *attr,
dwarf2_locexpr_baton->data has lifetime of PER_CU->OBJFILE. */
struct dwarf2_locexpr_baton
-dwarf2_fetch_die_location_block (cu_offset offset_in_cu,
- struct dwarf2_per_cu_data *per_cu,
- CORE_ADDR (*get_frame_pc) (void *baton),
- void *baton)
+dwarf2_fetch_die_loc_sect_off (sect_offset offset,
+ struct dwarf2_per_cu_data *per_cu,
+ CORE_ADDR (*get_frame_pc) (void *baton),
+ void *baton)
{
- sect_offset offset = { per_cu->offset.sect_off + offset_in_cu.cu_off };
struct dwarf2_cu *cu;
struct die_info *die;
struct attribute *attr;
@@ -17394,6 +17393,20 @@ dwarf2_fetch_die_location_block (cu_offset offset_in_cu,
return retval;
}
+/* Like dwarf2_fetch_die_loc_sect_off, but take a CU
+ offset. */
+
+struct dwarf2_locexpr_baton
+dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu,
+ struct dwarf2_per_cu_data *per_cu,
+ CORE_ADDR (*get_frame_pc) (void *baton),
+ void *baton)
+{
+ sect_offset offset = { per_cu->offset.sect_off + offset_in_cu.cu_off };
+
+ return dwarf2_fetch_die_loc_sect_off (offset, per_cu, get_frame_pc, baton);
+}
+
/* Return the type of the DIE at DIE_OFFSET in the CU named by
PER_CU. */