Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Michael Snyder" <michsnyd@cisco.com>
To: <gdb-patches@sources.redhat.com>
Cc: <jimb@redhat.com>, <ezannoni@redhat.com>
Subject: [RFA] stabs tweak -- forward reference types
Date: Thu, 11 Nov 2004 21:12:00 -0000	[thread overview]
Message-ID: <002a01c4c833$2030e8a0$5ca56b80@msnyder8600> (raw)

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);


             reply	other threads:[~2004-11-11 21:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-11 21:12 Michael Snyder [this message]
2004-11-11 21:30 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002a01c4c833$2030e8a0$5ca56b80@msnyder8600' \
    --to=michsnyd@cisco.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox