From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: printing pointers to global (data) variable on Windows...
Date: Thu, 16 Aug 2012 20:07:00 -0000 [thread overview]
Message-ID: <87zk5umwj3.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20120816152255.GA2836@adacore.com> (Joel Brobecker's message of "Thu, 16 Aug 2012 08:22:55 -0700")
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> 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
next prev parent reply other threads:[~2012-08-16 20:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 15:23 Joel Brobecker
2012-08-16 20:07 ` Tom Tromey [this message]
2012-08-16 22:45 ` Joel Brobecker
2012-08-17 14:23 ` Tom Tromey
2012-08-17 23:16 ` Joel Brobecker
2012-08-20 15:09 ` Joel Brobecker
2012-08-20 17:50 ` Tom Tromey
2012-08-21 15:28 ` Joel Brobecker
2012-08-20 17:48 ` Tom Tromey
2012-08-21 15:36 ` Joel Brobecker
2012-09-05 14:44 ` Joel Brobecker
2012-09-06 1:28 ` asmwarrior
2012-09-06 1:44 ` Joel Brobecker
2012-09-06 2:03 ` asmwarrior
2012-09-10 19:08 ` Tom Tromey
2012-09-10 22:13 ` Joel Brobecker
2012-09-11 13:49 ` Tom Tromey
2012-09-11 21:27 ` Joel Brobecker
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=87zk5umwj3.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=brobecker@adacore.com \
--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