From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9141 invoked by alias); 11 Feb 2006 20:21:04 -0000 Received: (qmail 9132 invoked by uid 22791); 11 Feb 2006 20:21:04 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sat, 11 Feb 2006 20:21:02 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F81Ep-00079x-FV; Sat, 11 Feb 2006 15:20:59 -0500 Date: Sat, 11 Feb 2006 20:21:00 -0000 From: Daniel Jacobowitz To: Fred Fish Cc: Jim Blandy , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix ptype problem printing typedefs defined differently in different compilation units Message-ID: <20060211202059.GB27289@nevyn.them.org> Mail-Followup-To: Fred Fish , Jim Blandy , gdb-patches@sourceware.org References: <200601031517.50309.fnf@specifix.com> <200602101935.06700.fnf@specifix.com> <20060211183500.GA25132@nevyn.them.org> <200602111501.01801.fnf@specifix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200602111501.01801.fnf@specifix.com> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00267.txt.bz2 On Sat, Feb 11, 2006 at 03:01:01PM -0500, Fred Fish wrote: > > It looks to me like, with objectprint set, ptype and whatis will now > > blow up; they call value_rtti_target_type without initializing val. > > Yup. The fix would be to remove the test of type==NULL and always > initialize val, whether or not ptype_eval finds a type to print. Well, if the results of ptype_eval and evaluate_type are inconsistent here, won't the result of doing this be meaningless? And if they were already consistent, then I'm a little confused how your patch works. Actually I think I'm a little confused either way. If ptype_eval failed evaluate_type would eventually get called, and that ought to handle OP_VAR_VALUE just fine. > Apparently we don't have any test in the gdb testsuite that checks > using objectprint, as there we no regressions when I ran it after the > change. Yes, unfortunately, I suspect this is true. > > Also ptype will now do the RTTI lookup; I'm not sure whether it > > should or not. > > Not sure either, now that you point it out. Might as well let it. -- Daniel Jacobowitz CodeSourcery