From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19737 invoked by alias); 4 May 2008 00:43:39 -0000 Received: (qmail 19728 invoked by uid 22791); 4 May 2008 00:43:38 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 04 May 2008 00:43:17 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id m440hEEn240192 for ; Sun, 4 May 2008 00:43:14 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m440hDj12650156 for ; Sun, 4 May 2008 02:43:13 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m440hDhE000374 for ; Sun, 4 May 2008 02:43:13 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m440hDtW000371 for ; Sun, 4 May 2008 02:43:13 +0200 Message-Id: <200805040043.m440hDtW000371@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sun, 4 May 2008 02:43:13 +0200 Subject: [commit] Fix backtrace past "clone" on powerpc To: gdb-patches@sourceware.org Date: Sun, 04 May 2008 04:04:00 -0000 From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00158.txt.bz2 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