From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3558 invoked by alias); 23 Jan 2006 16:12:19 -0000 Received: (qmail 3544 invoked by uid 22791); 23 Jan 2006 16:12:19 -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; Mon, 23 Jan 2006 16:12:15 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F14Ic-0004hK-Ur; Mon, 23 Jan 2006 11:12:11 -0500 Date: Mon, 23 Jan 2006 16:12: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: <20060123161210.GC17767@nevyn.them.org> Mail-Followup-To: Fred Fish , Jim Blandy , gdb-patches@sourceware.org References: <200601031517.50309.fnf@specifix.com> <20060115184800.GA9948@nevyn.them.org> <8f2776cb0601152022w6985d911y101f8a7d964f83b6@mail.gmail.com> <200601231027.05302.fnf@specifix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200601231027.05302.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-01/txt/msg00330.txt.bz2 On Mon, Jan 23, 2006 at 10:27:05AM -0500, Fred Fish wrote: > On Sunday 15 January 2006 23:22, Jim Blandy wrote: > > On 1/15/06, Daniel Jacobowitz wrote: > > > Given the followups, I think this patch is OK. Jim, do you agree? > > > > I think we're going to end up coming back to it, but the patch is > > definitely an improvement over the status quo, and doesn't interfere > > with further improvements, so I think the patch is okay too. > > The patch doesn't work though if there is a current frame, from > debugging a running process or examining a core file. This is because > of the order for searching for the block: > > if (!block) > block = get_selected_block (&expression_context_pc); > > if (!block) > { > struct symtab_and_line cursal = get_current_source_symtab_and_line (); > if (cursal.symtab) > block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (cursal.symtab), STATIC_BLOCK); > } I don't understand. What doesn't work? Is it something that works without the patch, or not? I don't understand how your examples relate to your description of the problem anymore. If we're going to continue discussing this issue for much longer, I may ask you to disable the test case. > So something like the following, which currently produces an error: > > (gdb) ptype 'main.c'::foo > Cannot look up value of a typedef Well that seems like a reasonable thing to fix anyway; ptype (and sizeof!) should be using a non-side-effects evaluation anyway. -- Daniel Jacobowitz CodeSourcery