Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] stabs tweak -- forward reference types
@ 2004-11-11 21:12 Michael Snyder
  2004-11-11 21:30 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Snyder @ 2004-11-11 21:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: jimb, ezannoni

Jim, Elena, 

There was a change about two years ago, related to G++ and derived classes.
See "complain_about_struct_wipeout" for comments.

I have evidence that this change was too aggressive, and that it sometimes
interferes with the resolution of forward referenced struct pointer types.
Unfortunately, I'm not having any luck constructing a small testcase.

So I hope to convince you that the small change proposed below is harmless.
According to the comments, the earlier change was only concerned with
derived types.  If we check N_BASECLASS and see that a type has no
base classes, then it should be safe.  Yes?  

I've confirmed that the present change has positive side effects -- it 
results in forward references being resolved that were being left
unresolved before.  I don't know how to confirm that it has no negative
side effects, since I don't know how to test the earlier derived class issue.

Michael

2004-11-11  msnyder  <msnyder@redhat.com>

 * stabsread.c (read_struct_type): complain_about_struct_wipeout
 only if struct is a derived type.

Index: stabsread.c
===================================================================
RCS file: /cvs/src/src/gdb/stabsread.c,v
retrieving revision 1.77
diff -p -r1.77 stabsread.c
*** stabsread.c 30 Apr 2004 14:40:54 -0000 1.77
--- stabsread.c 11 Nov 2004 21:04:52 -0000
*************** read_struct_type (char **pp, struct type
*** 3294,3303 ****
    if (! (TYPE_CODE (type) == TYPE_CODE_UNDEF
           || TYPE_STUB (type)))
      {
!       complain_about_struct_wipeout (type);
  
!       /* It's probably best to return the type unchanged.  */
!       return type;
      }
  
    back_to = make_cleanup (null_cleanup, 0);
--- 3294,3309 ----
    if (! (TYPE_CODE (type) == TYPE_CODE_UNDEF
           || TYPE_STUB (type)))
      {
!       /* Well, the above should only apply if type *has* a baseclass.
!   Otherwise, we may interfere with the resolution of forward
!   referenced struct types.  */
!       if (TYPE_N_BASECLASSES (type) > 0)
!  {
!    complain_about_struct_wipeout (type);
  
!    /* It's probably best to return the type unchanged.  */
!    return type;
!  }
      }
  
    back_to = make_cleanup (null_cleanup, 0);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFA] stabs tweak -- forward reference types
  2004-11-11 21:12 [RFA] stabs tweak -- forward reference types Michael Snyder
@ 2004-11-11 21:30 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2004-11-11 21:30 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches, jimb, ezannoni

On Thu, Nov 11, 2004 at 01:12:12PM -0800, Michael Snyder wrote:
> Jim, Elena, 
> 
> There was a change about two years ago, related to G++ and derived classes.
> See "complain_about_struct_wipeout" for comments.
> 
> I have evidence that this change was too aggressive, and that it sometimes
> interferes with the resolution of forward referenced struct pointer types.
> Unfortunately, I'm not having any luck constructing a small testcase.

Can you construct one just using .stabs directives?  This is what
gdb.stabs (and gdb.dwarf2) are for.

-- 
Daniel Jacobowitz


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-11 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-11 21:12 [RFA] stabs tweak -- forward reference types Michael Snyder
2004-11-11 21:30 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox