From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19704 invoked by alias); 2 Jan 2008 18:02:25 -0000 Received: (qmail 19677 invoked by uid 22791); 2 Jan 2008 18:02:24 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 02 Jan 2008 17:56:20 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id CAF2298121; Wed, 2 Jan 2008 17:56:05 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 904B998118; Wed, 2 Jan 2008 17:56:05 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1JA7oy-0008EC-K8; Wed, 02 Jan 2008 12:56:04 -0500 Date: Wed, 02 Jan 2008 18:02:00 -0000 From: Daniel Jacobowitz To: Gary Funck Cc: GDB List Subject: Re: how to search for a global type? Message-ID: <20080102175604.GA31562@caradoc.them.org> Mail-Followup-To: Gary Funck , GDB List References: <20071231042844.GA18814@intrepid.com> <20080102031750.GA27872@caradoc.them.org> <20080102051626.GB1259@intrepid.com> <20080102130630.GA31874@caradoc.them.org> <20080102174158.GH30197@intrepid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080102174158.GH30197@intrepid.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00005.txt.bz2 On Wed, Jan 02, 2008 at 09:41:58AM -0800, Gary Funck wrote: > I did try lookup_symbol() as well, no go. You may need to trace how ptype finds it, then. I would expect lookup_symbol to work. If there is no symbol in the global blocks, it falls back to static blocks (not just the current file's). search_symbols is going to be much less efficient. > I think one difficulty is that the current file doesn't > define the type. It is defined in the runtime files. > > I haven't tried following the logic, but could you briefly > explain the raltionship between block vectors and symbol > tables? Each file has a blockvector. Block 0 is its contribution to the global symbol table. Block 1 is its static symbol table, including things like types. Later blocks are children of one or the other, representing functions (and further inner blocks of functions). The symbol table is made up of the contents of those blocks, though indexed differently (I think, I have not checked in a while). -- Daniel Jacobowitz CodeSourcery