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: [RFA]dwarf reader: Avoid complaint on const type


I hope you're not waiting for me to review this.  (Honestly, in cases
like these, I prefer to simply revert the original broken patch, and
then calmly build a new correct patch from scratch.  It becomes
much easier to see and understand what was being addressed originaly
instead of having to look at the code in 3D.  I've noticed that
people here have revert fobia though ;-) ).

On Tuesday 29 June 2010 14:09:41, Pierre Muller wrote:
>  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);
> 
> 


-- 
Pedro Alves


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