From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4155 invoked by alias); 30 Oct 2002 22:06:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4130 invoked from network); 30 Oct 2002 22:06:15 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 30 Oct 2002 22:06:15 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 1871uC-00007J-00; Wed, 30 Oct 2002 17:05:44 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 1870zG-0003e3-00; Wed, 30 Oct 2002 17:06:54 -0500 Date: Wed, 30 Oct 2002 14:06:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Cc: kettenis@gnu.org Subject: RFA: Fix i386-linux backtrace through signal handlers Message-ID: <20021030220654.GA13990@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com, kettenis@gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i X-SW-Source: 2002-10/txt/msg00591.txt.bz2 The patch to fix the testsuite problems in my last message. The comment is pretty self-explanatory; this is option "B" from our earlier conversation. If we appear to be in a function whose name includes "sigaction", use the PC scanner instead of trusting the name. OK? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer 2002-10-30 Daniel Jacobowitz * i386-linux-tdep.c (i386_linux_pc_in_sigtramp): Check for trampolines in sigaction. Index: i386-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v retrieving revision 1.17 diff -u -p -r1.17 i386-linux-tdep.c --- i386-linux-tdep.c 12 Aug 2002 19:05:33 -0000 1.17 +++ i386-linux-tdep.c 30 Oct 2002 22:01:14 -0000 @@ -209,11 +209,17 @@ i386_linux_rt_sigtramp_start (CORE_ADDR static int i386_linux_pc_in_sigtramp (CORE_ADDR pc, char *name) { - if (name) - return STREQ ("__restore", name) || STREQ ("__restore_rt", name); - - return (i386_linux_sigtramp_start (pc) != 0 - || i386_linux_rt_sigtramp_start (pc) != 0); + /* If we have NAME, we can optimize the search. The trampolines are + named __restore and __restore_rt. However, they aren't dynamically + exported from the shared C library, so the trampoline may appear to + be part of the preceding function. This should always be sigaction, + __sigaction, or __libc_sigaction (all aliases to the same function). */ + if (name == NULL || strstr (name, "sigaction") != NULL) + return (i386_linux_sigtramp_start (pc) != 0 + || i386_linux_rt_sigtramp_start (pc) != 0); + + return (strcmp ("__restore", name) == 0 + || strcmp ("__restore_rt", name) == 0); } /* Assuming FRAME is for a GNU/Linux sigtramp routine, return the