From: "Maciej W. Rozycki" <macro@mips.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org, Nigel Stephens <nigel@mips.com>,
"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: Do not unwind frames past NULL PC
Date: Mon, 25 Feb 2008 19:19:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.61.0802251151480.28703@perivale.mips.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0802221806130.21569@perivale.mips.com>
On Fri, 22 Feb 2008, Maciej W. Rozycki wrote:
> Hmm, it looks it has been discussed deeply and fiercely enough for me not
> to dare question the outcome (or the lack of), but given the situation
> wouldn't it be reasonable to place a comment within the code of this
> function stating that outermost frame determination has been deliberately
> omitted so that cases like stack corruption are easier for people to
> debug?
OK, here is the patch. I hope I have gathered the intent from the
discussions correctly and expressed it clearly enough.
Personally I think for MIPS there is no gain from printing a frame with a
zero PC. As for MIPS the frame is associated with the PC, there will
never be further backtrace past a zero PC, because there will never be a
frame described for the code address of zero. So whether the dangling
"frame" is displayed or not makes no difference -- unless there is an
error reported with a backtrace, the null PC will always be there. I
recognise that other architectures may have a different view on the frames
though.
2008-02-25 Maciej W. Rozycki <macro@mips.com>
* frame.c (get_prev_frame_1): Add a note about unwillingness to
check for the outermost frame.
OK to apply?
Maciej
gdb-get_prev_frame.diff
Index: binutils-quilt/src/gdb/frame.c
===================================================================
--- binutils-quilt.orig/src/gdb/frame.c 2008-02-25 10:42:37.000000000 +0000
+++ binutils-quilt/src/gdb/frame.c 2008-02-25 11:48:56.000000000 +0000
@@ -1250,6 +1250,14 @@
}
}
+ /* This is the place where a check for the ABI-specific condition
+ denoting the outermost frame could be done. We do not do this
+ though, quite deliberately, because we have no means to verify
+ whether this condition would be intentional or a result of a
+ possible stack corruption. If the latter was the case we would
+ remove information from output which for some ABIs could
+ provide a hint that a stack corruption actually happened. */
+
/* Allocate the new frame but do not wire it in to the frame chain.
Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along
frame->next to pull some fancy tricks (of course such code is, by
prev parent reply other threads:[~2008-02-25 12:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-22 17:21 Maciej W. Rozycki
2008-02-22 18:31 ` Daniel Jacobowitz
2008-02-22 19:50 ` Maciej W. Rozycki
2008-02-25 19:19 ` Maciej W. Rozycki [this message]
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=Pine.LNX.4.61.0802251151480.28703@perivale.mips.com \
--to=macro@mips.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=macro@linux-mips.org \
--cc=nigel@mips.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