This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: dwarf2 class handling patch
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: dwarf2 class handling patch
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 14 Feb 2000 15:35:24 +1100
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <199911240949.BAA18700@yorick.cygnus.com> <u9ln5uhh9t.fsf@yorick.cygnus.com>
Jason Merrill wrote:
>
> Ping? Without this patch, gdb gets things wrong with the current gcc.
>
> >>>>> Jason Merrill <jason@cygnus.com> writes:
>
> > The dwarf2 spec says that an incomplete type will have AT_declaration set.
> > Some changes I'm making to gcc will produce class DIEs with children that
> > should still be considered incomplete.
>
> > 1999-11-24 Jason Merrill <jason@casey.cygnus.com>
>
> > * dwarf2read.c (die_is_declaration): New fn.
> > (read_structure_scope): Use it.
>
FYI,
I've committed the attatched. (I ripped out the PARAMS / K&R C stuff
which is no required in GDB)
Andrew
Mon Feb 14 15:20:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
From 1999-11-24 Jason Merrill <jason@casey.cygnus.com>:
* dwarf2read.c: (die_is_declaration): New fn.
(read_structure_scope): Use it.
* dwarf2read.c: (die_is_declaration): Convert to ISO-C.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.1.1.10
diff -p -r1.1.1.10 dwarf2read.c
*** dwarf2read.c 2000/02/05 07:29:43 1.1.1.10
--- dwarf2read.c 2000/02/14 04:21:44
*************** static void set_cu_language PARAMS ((uns
*** 621,626 ****
--- 621,628 ----
static struct attribute *dwarf_attr PARAMS ((struct die_info *,
unsigned int));
+ static int die_is_declaration (struct die_info *);
+
static void dwarf_decode_lines PARAMS ((unsigned int, char *, bfd *));
static void dwarf2_start_subfile PARAMS ((char *, char *));
*************** read_structure_scope (die, objfile)
*** 2202,2208 ****
type within the structure itself. */
die->type = type;
! if (die->has_children)
{
struct field_info fi;
struct die_info *child_die;
--- 2204,2210 ----
type within the structure itself. */
die->type = type;
! if (die->has_children && ! die_is_declaration (die))
{
struct field_info fi;
struct die_info *child_die;
*************** dwarf_attr (die, name)
*** 3698,3703 ****
--- 3700,3712 ----
}
return NULL;
+ }
+
+ static int
+ die_is_declaration (struct die_info *die)
+ {
+ return (dwarf_attr (die, DW_AT_declaration)
+ && ! dwarf_attr (die, DW_AT_specification));
}
/* Decode the line number information for the compilation unit whose