From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4904 invoked by alias); 9 Apr 2012 18:00:46 -0000 Received: (qmail 4895 invoked by uid 22791); 9 Apr 2012 18:00:45 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_XA,T_RP_MATCHES_RCVD 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; Mon, 09 Apr 2012 18:00:32 +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 q39I0U3f010618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Apr 2012 14:00:30 -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 q39I0TCZ013161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Apr 2012 14:00:29 -0400 From: Tom Tromey To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [2/2] RFA: implement 'set print symbol' References: <871uo2giob.fsf@fleche.redhat.com> <83obr5c27t.fsf@gnu.org> <87hawtasc9.fsf@fleche.redhat.com> <83zkak7ttt.fsf@gnu.org> <87zkak94w8.fsf@fleche.redhat.com> <83r4vw7pwv.fsf@gnu.org> Date: Mon, 09 Apr 2012 18:00:00 -0000 In-Reply-To: <83r4vw7pwv.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Apr 2012 20:53:20 +0300") Message-ID: <87r4vw945e.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (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-04/txt/msg00156.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: Eli> Maybe I misunderstand what "set print symbol-filename" does, but at Eli> least the manual seems to imply that it affects "print /a": Eli> If you have a pointer and you are not sure where it points, try Eli> @samp{set print symbol-filename on}. Then you can determine the name Eli> and source file location of the variable where it points, using Eli> @samp{p/a @var{pointer}}. This interprets the address in symbolic Eli> form. Eli> And your change makes it so the symbol is printed even without the /a Eli> part, AFAIU. So what am I missing? Suppose you have: char x; By default if you print it you get: (gdb) print &x $1 = 0xaaaaaa With /a: (gdb) p/a &x $2 = 0xaaaaaa My patch makes the output look like this all the time. 'set print symbol-filename on' only works for function symbols: (gdb) p /a &x $3 = 0xaaaaaa (gdb) p &main $4 = (int (*)()) 0x400474
It just adds the "at q.c:4" bit. Tom