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] Fix PR 9675 - _static_ variables in C++ constructors


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> Fix visibility of _static_ variables in C++ constructors,
Jan> as I saw it now even in GDB BZ:
Jan> http://sourceware.org/bugzilla/show_bug.cgi?id=9675
Jan> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33044
Jan> https://bugzilla.redhat.com/show_bug.cgi?id=445912

Thanks for writing this.

It took me a while to understand this (I had to go read up on the
DWARF involved), but I think I get what is going on here.

I have a couple comments.

Jan>        while (child_die && child_die->tag)
Jan>  	{
Jan> -	  process_die (child_die, cu);
Jan> +	  attr = dwarf2_attr (child_die, DW_AT_abstract_origin, cu);
Jan> +	  if (!attr)
Jan> +	    complaint (&symfile_complaints,
Jan> +		       _("Child DIE 0x%x of DIE 0x%x has missing "
Jan> +			 "DW_AT_abstract_origin"), child_die->offset,
Jan> +		       die->offset);

I suspect this complaint is incorrect.  DWARF 3.3.8.3 exception #3
says that a DIE in the concrete tree does not necessarily need to
refer to a DIE in the origin tree.  If I understand the patch
correctly, this complaint will be issued in exactly this case.  Is
that accurate?

Jan> +	if (offsetp[-1] == *offsetp)
Jan> +	  complaint (&symfile_complaints,
Jan> +		     _("Child DIEs of DIE 0x%x duplicitly abstract-origin "
Jan> +		       "referenced DIE 0x%x"), die->offset, *offsetp);

This text reads strangely.  How about:

 Multiple children of DIE 0x%s refer to DIE 0x%x as their abstract origin


Other than these things this patch looks ok to me.

Tom


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