From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15596 invoked by alias); 28 Feb 2007 06:23:45 -0000 Received: (qmail 15586 invoked by uid 22791); 28 Feb 2007 06:23:44 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 28 Feb 2007 06:23:35 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id DF70748D1C9 for ; Wed, 28 Feb 2007 01:23:33 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29244-01-10; Wed, 28 Feb 2007 01:23:32 -0500 (EST) Received: from takamaka.act-europe.fr (unknown [70.71.0.212]) by nile.gnat.com (Postfix) with ESMTP id E9A7D48CDE2; Wed, 28 Feb 2007 01:23:31 -0500 (EST) Received: by takamaka.act-europe.fr (Postfix, from userid 1000) id A512EE7972; Tue, 27 Feb 2007 22:23:37 -0800 (PST) Date: Wed, 28 Feb 2007 06:23:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Jerome Guitton Subject: [RFA] Fix failed assertion hit in check_typedef Message-ID: <20070228062337.GS13153@adacore.com> References: <20070227071658.GB13159@adacore.com> <20070227120239.GB5164@caradoc.them.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="hHWLQfXTYDoKhP50" Content-Disposition: inline In-Reply-To: <20070227120239.GB5164@caradoc.them.org> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-02/txt/msg00370.txt.bz2 --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 993 [switching to gdb-patches] Hi Daniel, > How about doing it in the caller? If you go to check_typedef, you'll > see that there's already an example of the same thing. If this is > DWARF2 and only started happening recently it may be the fault of your > recent fixes for what empty types constitute a declaration. Duh, of course! I'm sorry for not having seen this. Funny enough, just after I worked on this and sent this message to this list, Someone from the Paris office hit this very same problem, and I found a checkin in our tree waiting for me when I woke up. I think the patch follows your suggestion, so here is a slightly modified version. 2007-02-28 Jerome Guitton Joel Brobecker * gdbtypes.c (check_typedef): Do not replace stub type if the resolved type is not defined in the same objfile. I tested it on x86-linux, no regression. Also fixes the problem at hand. OK to commit? Thanks, -- Joel --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gdbtypes.c.diff" Content-length: 905 Index: gdbtypes.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtypes.c,v retrieving revision 1.112 diff -u -p -r1.112 gdbtypes.c --- gdbtypes.c 29 Jan 2007 17:31:05 -0000 1.112 +++ gdbtypes.c 27 Feb 2007 23:24:06 -0000 @@ -1514,7 +1514,15 @@ check_typedef (struct type *type) } sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL); if (sym) - make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type); + { + /* Same as above for opaque types, we can replace the stub + with the complete type only if they are int the same + objfile. */ + if (TYPE_OBJFILE (SYMBOL_TYPE(sym)) == TYPE_OBJFILE (type)) + make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type); + else + type = SYMBOL_TYPE (sym); + } } if (TYPE_TARGET_STUB (type)) --hHWLQfXTYDoKhP50--