From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4498 invoked by alias); 16 Aug 2012 22:45:41 -0000 Received: (qmail 4487 invoked by uid 22791); 16 Aug 2012 22:45:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Aug 2012 22:45:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7352F1C662E; Thu, 16 Aug 2012 18:45:26 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EQhd4jOR7B87; Thu, 16 Aug 2012 18:45:26 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 43DD51C62B7; Thu, 16 Aug 2012 18:45:26 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 5B29D14561A; Thu, 16 Aug 2012 15:45:24 -0700 (PDT) Date: Thu, 16 Aug 2012 22:45:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: printing pointers to global (data) variable on Windows... Message-ID: <20120816224524.GC2798@adacore.com> References: <20120816152255.GA2836@adacore.com> <87zk5umwj3.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zk5umwj3.fsf@fleche.redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2012-08/txt/msg00467.txt.bz2 > I think the reason for this is here: > > http://sourceware.org/ml/gdb-patches/2012-04/msg00175.html Thanks for the pointer! > Joel> My second question is regarding the fact that we looking symbols for > Joel> functions only. This probably made sense if the function was used for > Joel> text addresses (like disass), but does it now? Or perhaps it's the > Joel> GNU/Linux output that should be fixed, and only text symbols should > Joel> be printed when printing addresses (somehow, I do not think that this > Joel> would be right). > > IIRC the full symbol tables only record address information for text > symbols, not for data symbols. If so, one cannot do this lookup. I do not understand this part, though. Searches by name should return global variables too, no? > Ok, horrible idea. Perhaps some flag bit on the minsym instead? > Or on the objfile? You mean, setting a flag that allows us to know that sizes are not available, and thus avoid the heuristics/filtering? I wish we could have consistent behavior instead, but that might not be achievable. I thought about setting the size to -1, but that would open its own can of worms, I imagine, and that's not doable either, because the symbol size is an unsigned value (as it should be, if you ask me). Looking at the definition of struct minimal_symbol, it looks like we'd have some room for an extra flag. But I am not sure I really want to go that way. The filtering wouldn't be a problem if we were searching for all global symbols, not just functions. -- Joel