From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12069 invoked by alias); 11 Nov 2004 21:12:26 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11966 invoked from network); 11 Nov 2004 21:12:19 -0000 Received: from unknown (HELO sj-iport-2.cisco.com) (171.71.176.71) by sourceware.org with SMTP; 11 Nov 2004 21:12:19 -0000 Received: from sj-core-5.cisco.com (171.71.177.238) by sj-iport-2.cisco.com with ESMTP; 11 Nov 2004 13:24:22 -0800 Received: from msnyder8600 (dhcp-128-107-165-92.cisco.com [128.107.165.92]) by sj-core-5.cisco.com (8.12.10/8.12.6) with SMTP id iABLCFcp005201; Thu, 11 Nov 2004 13:12:16 -0800 (PST) Message-ID: <002a01c4c833$2030e8a0$5ca56b80@msnyder8600> From: "Michael Snyder" To: Cc: , Subject: [RFA] stabs tweak -- forward reference types Date: Thu, 11 Nov 2004 21:12:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00247.txt.bz2 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 * 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);