From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5427 invoked by alias); 16 Aug 2012 20:07:03 -0000 Received: (qmail 5372 invoked by uid 22791); 16 Aug 2012 20:07:02 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,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; Thu, 16 Aug 2012 20:06:43 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7GK6gqv008802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Aug 2012 16:06:42 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7GK6eUo004557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 16 Aug 2012 16:06:41 -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> Date: Thu, 16 Aug 2012 20:07:00 -0000 In-Reply-To: <20120816152255.GA2836@adacore.com> (Joel Brobecker's message of "Thu, 16 Aug 2012 08:22:55 -0700") Message-ID: <87zk5umwj3.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/msg00458.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> if (msymbol != NULL Joel> && MSYMBOL_SIZE (msymbol) == 0 Joel> && MSYMBOL_TYPE (msymbol) != mst_text Joel> && MSYMBOL_TYPE (msymbol) != mst_text_gnu_ifunc Joel> && MSYMBOL_TYPE (msymbol) != mst_file_text) Joel> msymbol = NULL; I think the reason for this is here: http://sourceware.org/ml/gdb-patches/2012-04/msg00175.html text symbols are allowed since without them (according to a later message) asm-source.exp would regress. Joel> I looked at the COFF/PE documentation, and I do not think that there Joel> is a way to provide the size of each symbol in the symbol table. Joel> So the block of code above discards our minimal symbol entry due to Joel> the size (always) being zero. And since our global is not a function, Joel> we do not find anything from the debugging info either. Joel> Does anyone know why we have the block discarding zero-sized non-text Joel> symbols? I ran the testsuite on x86_64-linux, and got no regression. I wonder what happens if you set the symbol sizes to 1. Ok, horrible idea. Perhaps some flag bit on the minsym instead? Or on the objfile? 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. That's what I remember from when I wrote this change. It would be nice to be wrong since the current approach means we can't always print a sensible answer for users. Tom