This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] stabs tweak -- forward reference types
- From: "Michael Snyder" <michsnyd at cisco dot com>
- To: <gdb-patches at sources dot redhat dot com>
- Cc: <jimb at redhat dot com>, <ezannoni at redhat dot com>
- Date: Thu, 11 Nov 2004 13:12:12 -0800
- Subject: [RFA] stabs tweak -- forward reference types
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);