This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] dwarf2_read_addr_index: Fix handling the case where cu == NULL.
- From: dje at google dot com
- To: gdb-patches at sourceware dot org
- Cc: saugustine at google dot com, ccoutant at google dot com
- Date: Wed, 12 Sep 2012 12:01:16 -0700
- Subject: [commit] dwarf2_read_addr_index: Fix handling the case where cu == NULL.
Hi.
When cu == NULL here we need to reread the top level die and get
DW_AT_GNU_addr_base.
Tested with amd64-linux + fission, and committed.
2012-09-12 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf2_read_addr_index): Fix handling the case where
cu == NULL.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.703
diff -u -p -r1.703 dwarf2read.c
--- dwarf2read.c 11 Sep 2012 22:42:22 -0000 1.703
+++ dwarf2read.c 12 Sep 2012 00:40:35 -0000
@@ -13728,8 +13728,9 @@ dwarf2_read_addr_index (struct dwarf2_pe
We don't need to read the entire CU(/TU).
We just need the header and top level die.
+
IWBN to use the aging mechanism to let us lazily later discard the CU.
- See however init_cutu_and_read_dies_simple. */
+ For now we skip this optimization. */
if (cu != NULL)
{
@@ -13740,8 +13741,10 @@ dwarf2_read_addr_index (struct dwarf2_pe
{
struct dwarf2_read_addr_index_data aidata;
- init_cutu_and_read_dies_simple (per_cu, dwarf2_read_addr_index_reader,
- &aidata);
+ /* Note: We can't use init_cutu_and_read_dies_simple here,
+ we need addr_base. */
+ init_cutu_and_read_dies (per_cu, NULL, 0, 0,
+ dwarf2_read_addr_index_reader, &aidata);
addr_base = aidata.addr_base;
addr_size = aidata.addr_size;
}