This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA]dwarf reader: Avoid complaint on const type
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Doug Evans'" <dje at google dot com>
- Cc: "'Pedro Alves'" <pedro at codesourcery dot com>, <gdb-patches at sourceware dot org>
- Date: Tue, 29 Jun 2010 15:09:41 +0200
- Subject: RE: [RFA]dwarf reader: Avoid complaint on const type
- References: <41597.7287375883$1274454923@news.gmane.org> <m3aart18ls.fsf@fleche.redhat.com> <201006161708.41089.pedro@codesourcery.com> <3752333521215815628@unknownmsgid> <AANLkTinrrd1jraPF95BXqQpKMke-s30gRnLBNspl3kMB@mail.gmail.com>
I agree with Doug's analysis that new_symbol
should never be called for those dwarf tags.
The most logical seems to just revert the addition of
of the two tags, which would lead to a complaint if
new_symbol would be called for those tags,
as it did before my original patch.
As Doug explained, this should not happen anymore
as new_symbol is only called from process_die
and the first part of the patch removes this call for
DW_TAG_const_type and DW_TAG_volatile_type.
Tested on x86_64 linux machine from GCC compiler farm,
nothing related to the patch seemed to appear.
(sigaltstack.exp showed failures but I don't think this is related).
Pierre
2010-06-29 Pierre Muller <muller@ics.u-strasbg.fr>
Doug Evans <dje@google.com>
* dwarf2read.c (process_die): Only call read_type_die function for
const and volatile modifiers.
(new_symbol): Revert change adding a new type for DW_TAG_const_type
or DW_TAG_volatile_type tag if it has a name attribute.
Index: src/gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.406
diff -u -p -r1.406 dwarf2read.c
--- src/gdb/dwarf2read.c 28 Jun 2010 22:03:31 -0000 1.406
+++ src/gdb/dwarf2read.c 29 Jun 2010 12:31:55 -0000
@@ -3220,12 +3220,15 @@ process_die (struct die_info *die, struc
case DW_TAG_base_type:
case DW_TAG_subrange_type:
case DW_TAG_typedef:
- case DW_TAG_const_type:
- case DW_TAG_volatile_type:
/* Add a typedef symbol for the type definition, if it has a
DW_AT_name. */
new_symbol (die, read_type_die (die, cu), cu);
break;
+ /* Type modifiers should be accepted without creating a new type
name. */
+ case DW_TAG_const_type:
+ case DW_TAG_volatile_type:
+ read_type_die (die, cu);
+ break;
case DW_TAG_common_block:
read_common_block (die, cu);
break;
@@ -8987,9 +8990,7 @@ new_symbol (struct die_info *die, struct
add_symbol_to_list (sym, cu->list_in_scope);
break;
case DW_TAG_base_type:
- case DW_TAG_subrange_type:
- case DW_TAG_const_type:
- case DW_TAG_volatile_type:
+ case DW_TAG_subrange_type:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, cu->list_in_scope);