aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-07-13 15:09:03 +0000
committerTom Tromey <tromey@redhat.com>2010-07-13 15:09:03 +0000
commit9aa1f1e33995b48c94b8d6833d071751aa02f751 (patch)
treebd6c031088dddbd90f9a9d9f23d252354f214846 /gdb/dwarf2read.c
parent6951728764c1d0d95285ea58a2ba2e335b73f4cd (diff)
downloadgdb-9aa1f1e33995b48c94b8d6833d071751aa02f751.zip
gdb-9aa1f1e33995b48c94b8d6833d071751aa02f751.tar.gz
gdb-9aa1f1e33995b48c94b8d6833d071751aa02f751.tar.bz2
* dwarf2loc.h (dwarf2_per_cu_text_offset): Declare.
* dwarf2loc.c (find_location_expression): Use dwarf2_per_cu_text_offset. (dwarf2_evaluate_loc_desc): Likewise. (dwarf2_loc_desc_needs_frame): Likewise. (compile_dwarf_to_ax): Likewise. (loclist_describe_location): Likewise. * dwarf2read.c (dwarf2_per_cu_text_offset): New function. (dwarf2_per_cu_objfile): Update comment.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index d128312..240bee1 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12049,7 +12049,9 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
}
}
-/* Return the OBJFILE associated with the compilation unit CU. */
+/* Return the OBJFILE associated with the compilation unit CU. If CU
+ came from a separate debuginfo file, then the master objfile is
+ returned. */
struct objfile *
dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *per_cu)
@@ -12108,6 +12110,19 @@ dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *per_cu)
}
}
+/* Return the text offset of the CU. The returned offset comes from
+ this CU's objfile. If this objfile came from a separate debuginfo
+ file, then the offset may be different from the corresponding
+ offset in the parent objfile. */
+
+CORE_ADDR
+dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *per_cu)
+{
+ struct objfile *objfile = per_cu->psymtab->objfile;
+
+ return ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+}
+
/* Locate the .debug_info compilation unit from CU's objfile which contains
the DIE at OFFSET. Raises an error on failure. */