From: Simon Marchi <simark@simark.ca>
To: William Tambe <tambewilliam@gmail.com>, gdb@sourceware.org
Subject: Re: Incorrect symbol name displayed in backtrace
Date: Fri, 07 Feb 2020 03:32:00 -0000 [thread overview]
Message-ID: <6b7c07bc-c461-ee85-51bb-b47478dfde03@simark.ca> (raw)
In-Reply-To: <CAF8i9mMNfeAt1z94vuLPN7rCav=z1=4fMXqLBxr7AgFPsJ4rZQ@mail.gmail.com>
On 2020-02-05 11:36 p.m., William Tambe wrote:
> Below is an example of backtrace where I find that GDB printed a
> symbol name that is not found at the address shown in the backtrace.
> In the example below, GDB says that __kprobes_text_start() is at
> 0x0039f000, however when I used p (void *)0x0039f000, it prints the
> correct symbol name at 0x0039f000.
>
> (gdb) bt
> #0 0x05000100 in _start ()
> #1 0x0039f000 in __kprobes_text_start ()
> Backtrace stopped: frame did not save the PC
> (gdb) p (void *)0x0039f000
> $6 = (void *) 0x39f000 <__tramp_exit>
>
>
> Any idea what is the difference in the way symbol names are printed in
> the backtrace and by the command "p" ?
The only reason I could imagine is that for the backtrace, GDB looks for
the closest code symbol, whereas with the print command, it looks for
any kind of symbol. And perhaps that in this case, __kprobes_text_start
is a code symbol whereas __tramp_exit is a data symbol.
Note that when GDB says:
#1 0x0039f000 in __kprobes_text_start ()
It doesn't mean that __kprobes_text_start == 0x0039f000, it's just that for
all it knows, the current address (0x0039f000) is in the function
__kprobes_text_start. What does "print __kprobes_text_start" say?
It's hard to tell without seeing the actual binary, so this is just a guess.
Simon
next prev parent reply other threads:[~2020-02-07 3:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 4:37 William Tambe
2020-02-07 3:32 ` Simon Marchi [this message]
2020-02-07 3:56 ` William Tambe
2020-02-07 5:25 ` Simon Marchi
2020-02-07 5:27 ` Simon Marchi
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=6b7c07bc-c461-ee85-51bb-b47478dfde03@simark.ca \
--to=simark@simark.ca \
--cc=gdb@sourceware.org \
--cc=tambewilliam@gmail.com \
/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