[rfa] pc bounds checking and namespaces

Elena Zannoni ezannoni@redhat.com
Mon Jan 19 00:05:00 GMT 2004


David Carlton writes:
 > When calculating the pc bounds for a block in dwarf2read.c, we assume
 > that all functions contained in that block are immediate children of
 > the block.  I was using a patched version of GCC where this doesn't
 > hold - the dies associated to definitions of functions in namespaces
 > are children of a DW_TAG_namespace die instead of the
 > DW_TAG_compile_unit die.  I don't know where GCC 3.4 puts the
 > relevant dies, so this might not be an issue with GCC 3.4, but it
 > might be; it seems like fixing that assumption is a good idea in any
 > case.
 > 
 > So this patch takes the code to calculate the lowpc/highpc out of
 > psymtab_to_symtab_1 and read_file_scope (where that functionality had
 > been duplicated), extracts it to a new function get_scope_pc_bounds,
 > and then modifies that new function to handle DW_TAG_namespace
 > appropriately.
 > 
 > I tried to come up with a test case for this, but I wasn't
 > successful. :-( I can say that, before this patch, I used to see a lot
 > of "pc 0xNNNN in read in psymtab, but not in symtab" messages when
 > debugging, and now I don't.
 > 
 > Tested on GCC 3.2 both with and without DW_TAG_namespace,
 > i686-pc-linux-gnu, DWARF-2; no regressions.  OK to commit?
 > 

Again, a sanity check with 2.95 and -gdwarf-2 would be good.



 > -    {
 > -      /* Some compilers don't define a DW_AT_high_pc attribute for
 > -         the compilation unit.   If the DW_AT_high_pc is missing,
 > -         synthesize it, by scanning the DIE's below the compilation unit.  */

I'd rather keep this comment around, probably at the first call.


Ok otherwise.

elena



More information about the Gdb-patches mailing list