This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [Daniel Berlin <dan@cgsoftware.com>] [PATCH] Namespace support for DWARF2, take 2
- To: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Subject: Re: [Daniel Berlin <dan@cgsoftware.com>] [PATCH] Namespace support for DWARF2, take 2
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Sat, 07 Jul 2001 19:50:20 -0400
- Cc: Daniel Berlin <dan at cgsoftware dot com>,gdb-patches at sources dot redhat dot com
- References: <87sngbtkdw.fsf@cgsoftware.com><np7kxmm4bx.fsf@zwingli.cygnus.com>
Jim Blandy <jimb@zwingli.cygnus.com> writes:
> Daniel Berlin <dan@cgsoftware.com> writes:
>> Jim, you asked me to forward the gcc dwarf2 namespace patch, here's the
>> latest.
>
> Cool, thanks. I'll try it out.
I updated it for namespace aliases, you can find a new
gen_namespace_die function on the gcc-patches list.
>
>> If you want to hack up the old reader to try to support namespaces, or
>> even ignore them, you have to start by copying the find_pc_bounds
>> function in the new dwarf2 reader, and using it in the right places.
>> Otherwise, you'll end up with errors about blocks being outside the
>> bounds of the symtab, etc, because namespaces are scopes without pc
>> bounds, and thus, we need to look through their children when trying
>> to determine the upper/lower pc bounds for a compile unit.
>
> Okay. It looks like scan_partial_symbols actually does more than just
> skim the top level of dies (to retrieve enumeration constants, for
> example), so that seems doable. But I'll look at your find_pc_bounds
> function, too.
It's not scan_partial you need it for, it's (in the old reader) in
psymtab_to_symtab_1, the part that says "/* Some compilers don't
define a DW_AT_high_pc attribute for the CU. .... synthesize it, by
scanning the DIE's below the CU. */", and read_file_scope.
Both don't scan below the immediate children.
--
"So I figured I'd leave the area, because I had no ties there
anyway except for this girl I was seeing. We had conflicting
attitudes: I really wasn't into meditating and she wasn't
really into being alive. I told her I knew when I was going to
die because my birth certificate has an expiration date.
"-Steven Wright