From: Tom Tromey <tromey@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [2/2] RFA: implement 'set print symbol'
Date: Mon, 09 Apr 2012 18:00:00 -0000 [thread overview]
Message-ID: <87r4vw945e.fsf@fleche.redhat.com> (raw)
In-Reply-To: <83r4vw7pwv.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Apr 2012 20:53:20 +0300")
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> 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 <x>
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 <x>
(gdb) p &main
$4 = (int (*)()) 0x400474 <main at q.c:4>
It just adds the "at q.c:4" bit.
Tom
next prev parent reply other threads:[~2012-04-09 18:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 18:03 Tom Tromey
2012-04-05 21:13 ` Eli Zaretskii
2012-04-09 14:32 ` Tom Tromey
2012-04-09 16:31 ` Eli Zaretskii
2012-04-09 17:44 ` Tom Tromey
2012-04-09 17:55 ` Eli Zaretskii
2012-04-09 18:00 ` Tom Tromey [this message]
2012-04-09 19:14 ` Jan Kratochvil
2012-04-09 19:21 ` Tom Tromey
2012-04-09 19:36 ` Jan Kratochvil
2012-04-09 20:45 ` Eli Zaretskii
2012-04-09 21:04 ` Tom Tromey
2012-04-10 6:17 ` Eli Zaretskii
2012-04-10 6:56 ` Jan Kratochvil
2012-04-10 7:50 ` Eli Zaretskii
2012-04-10 8:19 ` Jan Kratochvil
2012-04-16 21:14 ` Tom Tromey
2012-05-14 19:39 ` Tom Tromey
2012-04-17 0:54 ` Doug Evans
2012-04-17 11:43 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4vw945e.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox