From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20002 invoked by alias); 17 Aug 2012 14:23:49 -0000 Received: (qmail 19980 invoked by uid 22791); 17 Aug 2012 14:23:45 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Aug 2012 14:23:26 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7HENMvP031700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Aug 2012 10:23:22 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7HENKQT005519 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 17 Aug 2012 10:23:21 -0400 From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: RFC: printing pointers to global (data) variable on Windows... References: <20120816152255.GA2836@adacore.com> <87zk5umwj3.fsf@fleche.redhat.com> <20120816224524.GC2798@adacore.com> Date: Fri, 17 Aug 2012 14:23:00 -0000 In-Reply-To: <20120816224524.GC2798@adacore.com> (Joel Brobecker's message of "Thu, 16 Aug 2012 15:45:24 -0700") Message-ID: <87628hmwbr.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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/msg00479.txt.bz2 Tom> IIRC the full symbol tables only record address information for text Tom> symbols, not for data symbols. If so, one cannot do this lookup. Joel> I do not understand this part, though. Searches by name should return Joel> global variables too, no? build_address_symbolic is searching for the symbol by PC: symbol = find_pc_sect_function (addr, section); I think it would be reasonable, and maybe useful, if gdb could do by-address searches for data symbols. That was a bigger change than I wanted to make for the "set print symbol" series though. Tom> Ok, horrible idea. Perhaps some flag bit on the minsym instead? Tom> Or on the objfile? Joel> You mean, setting a flag that allows us to know that sizes are not Joel> available, and thus avoid the heuristics/filtering? Yeah. Joel> Looking at the definition of struct minimal_symbol, it looks like Joel> we'd have some room for an extra flag. Yes. pahole is super for this kind of thing... it reports a pretty big hole after target_flag_2. Joel> But I am not sure I really Joel> want to go that way. The filtering wouldn't be a problem if we were Joel> searching for all global symbols, not just functions. That would be best, but I'm out of ideas. I think the existing check is really what we want for ELF. Maybe for ELF we could find some way to mark symbols we don't want. But that's just the flag idea but the sense reversed. Tom