From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org
Subject: [commit] Fix backtrace past "clone" on powerpc
Date: Sun, 04 May 2008 04:04:00 -0000 [thread overview]
Message-ID: <200805040043.m440hDtW000371@d12av02.megacenter.de.ibm.com> (raw)
Hello,
backtrace in multi-threaded applications would tend to throw an error:
where^M
#0 0x0fcfdb34 in sem_wait@GLIBC_2.0 () from /lib/libpthread.so.0^M
#1 0x100008f0 in spin (vp=0x0) at /home/uweigand/fsf/gdb-head/gdb/testsuite/gdb.threads/tls.c:97^M
#2 0x0fcf6764 in start_thread () from /lib/libpthread.so.0^M
#3 0x0ff2c604 in clone () from /lib/libc.so.6^M
Backtrace stopped: previous frame inner to this frame (corrupt stack?)^M
because clone was not recognized to terminate the stack.
The patch below fixes this by having rs6000_frame_this_id return the null
frame ID in that case (just like many other targets do already).
Tested on powerpc-linux and powerpc64-linux; committed to mainline.
Bye,
Ulrich
ChangeLog:
* rs6000-tdep.c (rs6000_frame_this_id): If info->base is 0,
return the null frame ID to terminate the backtrace.
diff -urNp gdb-orig/gdb/rs6000-tdep.c gdb-head/gdb/rs6000-tdep.c
--- gdb-orig/gdb/rs6000-tdep.c 2008-05-04 02:07:36.026688000 +0200
+++ gdb-head/gdb/rs6000-tdep.c 2008-05-04 02:08:56.461342375 +0200
@@ -2550,6 +2550,10 @@ rs6000_frame_this_id (struct frame_info
{
struct rs6000_frame_cache *info = rs6000_frame_cache (this_frame,
this_cache);
+ /* This marks the outermost frame. */
+ if (info->base == 0)
+ return;
+
(*this_id) = frame_id_build (info->base, get_frame_func (this_frame));
}
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next reply other threads:[~2008-05-04 0:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-04 4:04 Ulrich Weigand [this message]
2008-05-04 11:53 ` Mark Kettenis
2008-05-04 13:14 ` Ulrich Weigand
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=200805040043.m440hDtW000371@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.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