From: Daniel Jacobowitz <drow@false.org>
To: Luis Machado <luisgpm@linux.vnet.ibm.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] Backtrace prints wrong argument value
Date: Wed, 16 May 2007 14:43:00 -0000 [thread overview]
Message-ID: <20070516144250.GD24682@caradoc.them.org> (raw)
In-Reply-To: <1179293640.4323.16.camel@localhost>
On Wed, May 16, 2007 at 02:34:00AM -0300, Luis Machado wrote:
> On Wed, 2007-04-25 at 15:13 -0400, Daniel Jacobowitz wrote:
> > A valid location list for func1 could say that arg1 is valid
> > in r20 during the call to abort; the -1 puts us on the call, instead
> > of after it, in the unrelated func2.
> >
> > I believe this is considered a known weakness of the DWARF
> > representation, which does not represent state before an instruction
> > separately from state after it. The debug info does not tell us
> > whether the location is valid in the middle of the call.
>
> Do you have anything in mind in order to better handle this situation
> instead of showing wrong values in backtrace every now and then?
>
> >From your comment it wasn't clear if hiding possibly wrong values is
> worse than showing them sometimes.
There is simply not enough information in the debug info to handle
this correctly. Let me give you another example:
move var to r3
test something
if true, branch to Lfoo
call abort, which clobbers r3
Lfoo:
do something with r3
At every instruction after the move, the debug info should say that
var is in r3. Right? No matter which location we pick here, while
backtracing from abort, we'll print the wrong value for var and
there's no point where the debug info will say it is undefined.
If you want us to get this right using DWARF info, I believe your only
choice is to approach the DWARF working group about it.
Now, in GDB we may have other options. We might be able to get the
list of call clobbered registers based on the ABI. Compare with s390,
which already does this (dwarf2_frame_set_init_reg). Does adding
this to PowerPC help your example any?
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-05-16 14:43 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 19:13 Luis Machado
2007-04-25 19:25 ` Daniel Jacobowitz
2007-04-25 22:28 ` Luis Machado
2007-04-30 13:31 ` Luis Machado
2007-05-16 5:34 ` Luis Machado
2007-05-16 14:43 ` Daniel Jacobowitz [this message]
2007-05-16 15:20 ` Luis Machado
2007-05-16 15:23 ` Daniel Jacobowitz
2007-09-13 14:47 ` Luis Machado
2007-09-16 19:45 ` Daniel Jacobowitz
2007-09-17 13:05 ` Luis Machado
2007-09-17 13:15 ` Daniel Jacobowitz
2007-09-17 13:30 ` Luis Machado
2007-09-17 13:37 ` Daniel Jacobowitz
2007-09-17 13:46 ` Luis Machado
2007-09-17 14:00 ` Luis Machado
2007-09-17 14:04 ` Daniel Jacobowitz
2007-09-17 16:02 ` Luis Machado
2007-09-17 17:15 ` Luis Machado
2007-09-17 17:18 ` Daniel Jacobowitz
2007-09-17 17:34 ` Luis Machado
2007-09-17 17:48 ` Daniel Jacobowitz
2007-10-03 14:58 ` Luis Machado
2007-10-21 21:41 ` Luis Machado
2007-10-22 0:03 ` Joel Brobecker
2007-10-22 1:20 ` Daniel Jacobowitz
2007-10-22 4:11 ` Joel Brobecker
2007-10-24 20:50 ` Daniel Jacobowitz
2007-10-24 20:59 ` Joel Brobecker
2007-10-24 21:01 ` Daniel Jacobowitz
2007-10-24 22:23 ` Pedro Alves
2007-10-24 22:38 ` Pedro Alves
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=20070516144250.GD24682@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=luisgpm@linux.vnet.ibm.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