This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] PR symtab/13277: Resolving opaque structures in ICC generated binaries.


On Sun, 16 Oct 2011 07:44:28 +0200, John Steele Scott wrote:
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -7636,6 +7636,11 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
>      /* RealView does not output the required DW_AT_declaration
>         on incomplete types.  */
>      TYPE_STUB (type) = 1;
> +  else if (attr != NULL&&  die->child == NULL&&  TYPE_LENGTH (type) == 0
> +	&&  producer_is_icc (cu->producer))

the formatting should be:
  else if (attr != NULL && die->child == NULL && TYPE_LENGTH (type) == 0
	   && producer_is_icc (cu->producer))

> +    /* ICC does not output the required DW_AT_declaration
> +       on incomplete types, but gives them a size of zero.  */
> +    TYPE_STUB (type) = 1;
> 
>    /* We need to add the type field to the die immediately so we don't
>       infinitely recurse when dealing with pointers to the structure
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index 9447bd9..ffaa035 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c

/* Return non-zero if PRODUCER is Intel C Compiler.  */

> +int
> +producer_is_icc (const char *producer)

This function should have some comment.  And it should be static in
dwarf2read.c itself as it is not used from any other source file now.

OK with those changes.


One could make a testcase by hand based for example on
gdb.dwarf2/dw2-struct-optimized-out.* .  I am not much fond of the `gcc -S'
output testcases.  But neither is required for a check-in.


Thanks,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]