From: "Valentin Vidić" <vvidic@valentin-vidic.from.hr>
To: kernelnewbies@kernelnewbies.org
Subject: Re: printk() format %pS wrong symbol
Date: Tue, 7 Jul 2020 20:39:27 +0200 [thread overview]
Message-ID: <20200707183927.GP6573@valentin-vidic.from.hr> (raw)
In-Reply-To: <CAF8i9mN1QGohck4BrRONrx=5+aNgnFR0T70ifz3nSrN5J=oBBA@mail.gmail.com>
On Mon, Jul 06, 2020 at 06:06:42PM -0400, William Tambe wrote:
> the issue I am having is due to sprint_backtrace() calling
> __sprint_symbol() with its argument symbol_offset == -1.
> Despite the comment above its definition, it is hard to understand why
> sprint_backtrace() calls __sprint_symbol() that way; in our port it
> results in printing incorrect symbols.
> As a workaround, we have made sprint_backtrace() to be the same as
> sprint_symbol().
From what I understand print_backtrace() tries to handle the case when
call is the last instruction in a function:
func1: ...
...
...
call noret_func3()
func2: ...
...
...
Return value on the stack points to the next instruction after the call.
But in this case a new function already starts on that address so they
add -1 to make the address point back to func1.
Not sure what goes wrong in your case, could you share an example and
more info on the port?
--
Valentin
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2020-07-07 18:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-04 10:11 printk() format %pS wrong symbol William Tambe
2020-07-04 10:29 ` Valentin Vidić
2020-07-04 16:04 ` William Tambe
2020-07-04 17:14 ` Valentin Vidić
2020-07-06 22:06 ` William Tambe
2020-07-07 18:39 ` Valentin Vidić [this message]
2020-07-07 18:53 ` Valentin Vidić
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=20200707183927.GP6573@valentin-vidic.from.hr \
--to=vvidic@valentin-vidic.from.hr \
--cc=kernelnewbies@kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).