From 9aa1f1e33995b48c94b8d6833d071751aa02f751 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 13 Jul 2010 15:09:03 +0000 Subject: * 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. --- gdb/dwarf2loc.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gdb/dwarf2loc.h') diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h index 3ff595e..826bc45 100644 --- a/gdb/dwarf2loc.h +++ b/gdb/dwarf2loc.h @@ -28,7 +28,9 @@ struct dwarf2_per_cu_data; /* This header is private to the DWARF-2 reader. It is shared between dwarf2read.c and dwarf2loc.c. */ -/* 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 *cu); /* Return the address size given in the compilation unit header for CU. */ @@ -37,6 +39,12 @@ CORE_ADDR dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu); /* Return the offset size given in the compilation unit header for CU. */ int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *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 *cu); + struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block (unsigned int offset, struct dwarf2_per_cu_data *per_cu); -- cgit v1.1