RFA: remember dwarf_line_size

Jim Blandy
2002-05-09T23:31:49Z

The change I committed May 6 to dwarf2read.c introduced the new
function dwarf_decode_line_header. That contained a bunch of
consistency checks which assumed that dwarf_line_size is actually
preserved between the partial symbol scan and the full symbol read.
It isn't.

This patch should fix the following failures under -gdwarf-2:

FAIL: gdb.base/shlib-call.exp: (timeout) print shr1(g)
ERROR: Couldn't send break shr2 to GDB.
UNRESOLVED: gdb.base/shlib-call.exp: breakpoint function shr2
ERROR: Couldn't send continue to GDB.
UNRESOLVED: gdb.base/shlib-call.exp: run until breakpoint set at a function
FAIL: gdb.base/shlib-call.exp: (timeout) print shr1(1) 2nd time
FAIL: gdb.base/shlib-call.exp: (timeout) print mainshr1(1) from shlib func
FAIL: gdb.base/shlib-call.exp: step inside shr2 (shlib func) (timeout)
FAIL: gdb.base/shlib-call.exp: step out of shr2 to main (timeout)
FAIL: gdb.base/shlib-call.exp: (timeout) print mainshr1(1) from main
FAIL: gdb.base/shlib-call.exp: step into mainshr1 (timeout)

2002-05-09 Jim Blandy <jimb@redhat.com>

Properly track the size of the current objfile's .debug_line section.
* dwarf2read.c (struct dwarf2_pinfo): New member: dwarf_line_size.
(DWARF_LINE_SIZE): New macro.
(dwarf2_build_psymtabs_hard): Record the line section's size in
the partial symbol table.
(psymtab_to_symtab_1): Restore dwarf_line_size from the partial
symbol table.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.54.2.1
diff -c -c -b -F'^(' -r1.54.2.1 dwarf2read.c
*** dwarf2read.c 9 May 2002 20:03:36 -0000 1.54.2.1
--- dwarf2read.c 9 May 2002 23:24:22 -0000
***************
*** 434,439 ****
--- 434,443 ----

char *dwarf_line_buffer;

+ /* Size of dwarf_line_buffer, in bytes. */
+
+ unsigned int dwarf_line_size;
+
/* Pointer to start of dwarf string buffer for the objfile. */

char *dwarf_str_buffer;
***************
*** 458,463 ****
--- 462,468 ----
#define DWARF_ABBREV_BUFFER(p) (PST_PRIVATE(p)->dwarf_abbrev_buffer)
#define DWARF_ABBREV_SIZE(p) (PST_PRIVATE(p)->dwarf_abbrev_size)
#define DWARF_LINE_BUFFER(p) (PST_PRIVATE(p)->dwarf_line_buffer)
+ #define DWARF_LINE_SIZE(p) (PST_PRIVATE(p)->dwarf_line_size)
#define DWARF_STR_BUFFER(p) (PST_PRIVATE(p)->dwarf_str_buffer)
#define DWARF_STR_SIZE(p) (PST_PRIVATE(p)->dwarf_str_size)
#define DWARF_MACINFO_BUFFER(p) (PST_PRIVATE(p)->dwarf_macinfo_buffer)
***************
*** 1222,1227 ****
--- 1227,1233 ----
DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer;
DWARF_ABBREV_SIZE (pst) = dwarf_abbrev_size;
DWARF_LINE_BUFFER (pst) = dwarf_line_buffer;
+ DWARF_LINE_SIZE (pst) = dwarf_line_size;
DWARF_STR_BUFFER (pst) = dwarf_str_buffer;
DWARF_STR_SIZE (pst) = dwarf_str_size;
DWARF_MACINFO_BUFFER (pst) = dwarf_macinfo_buffer;
***************
*** 1525,1530 ****
--- 1531,1537 ----
dwarf_abbrev_buffer = DWARF_ABBREV_BUFFER (pst);
dwarf_abbrev_size = DWARF_ABBREV_SIZE (pst);
dwarf_line_buffer = DWARF_LINE_BUFFER (pst);
+ dwarf_line_size = DWARF_LINE_SIZE (pst);
dwarf_str_buffer = DWARF_STR_BUFFER (pst);
dwarf_str_size = DWARF_STR_SIZE (pst);
dwarf_macinfo_buffer = DWARF_MACINFO_BUFFER (pst);