From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25973 invoked by alias); 26 Oct 2004 21:22:05 -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 25942 invoked from network); 26 Oct 2004 21:22:02 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 26 Oct 2004 21:22:02 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id i9QLM2EA024250 for ; Tue, 26 Oct 2004 17:22:02 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9QLM1r20271 for ; Tue, 26 Oct 2004 17:22:01 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i9QLM1bU032064 for ; Tue, 26 Oct 2004 17:22:01 -0400 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 5F743800044 for ; Tue, 26 Oct 2004 17:22:01 -0400 (EDT) Message-ID: <417EBFF9.5060104@redhat.com> Date: Tue, 26 Oct 2004 21:22:00 -0000 From: Jeff Johnston User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [RFA]: issue warnings for frame offenses Content-Type: multipart/mixed; boundary="------------020809090504040107020105" X-SW-Source: 2004-10/txt/msg00449.txt.bz2 This is a multi-part message in MIME format. --------------020809090504040107020105 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 985 The attached patch changes a few backtrace termination scenarios in frame.c to issue a warning and terminate the backtrace rather than use the error() function. The change is being made to help out end-users that use macros with backtraces in them. At present, there a number of platforms where backtraces through assembler code (e.g. glibc thread creation) cause backtraces to get somewhat lost. When the frame code issues the error, any macro issuing the backtrace is terminated. If an end-user is applying such a macro to all threads, it ends prematurely for no good reason. With the change, the message is still issued and the backtrace is stopped. Ok to commit? 2004-10-26 Jeff Johnston * frame.c (get_prev_frame_1): Change inner frame and equivalent frame tests to issue a warning rather than an error. (get_prev_frame): When backtrace limit is exceeded, terminate with a warning rather than an error. --------------020809090504040107020105 Content-Type: text/plain; name="frame.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="frame.patch" Content-length: 1642 Index: frame.c =================================================================== RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.191 diff -u -p -r1.191 frame.c --- frame.c 1 Sep 2004 14:13:33 -0000 1.191 +++ frame.c 26 Oct 2004 21:13:18 -0000 @@ -1036,14 +1036,20 @@ get_prev_frame_1 (struct frame_info *thi if (this_frame->next->level >= 0 && this_frame->next->unwind->type != SIGTRAMP_FRAME && frame_id_inner (this_id, get_frame_id (this_frame->next))) - error ("Previous frame inner to this frame (corrupt stack?)"); + { + warning ("Previous frame inner to this frame (corrupt stack?)"); + return NULL; + } /* Check that this and the next frame are not identical. If they are, there is most likely a stack cycle. As with the inner-than test above, avoid comparing the inner-most and sentinel frames. */ if (this_frame->level > 0 && frame_id_eq (this_id, get_frame_id (this_frame->next))) - error ("Previous frame identical to this frame (corrupt stack?)"); + { + warning ("Previous frame identical to this frame (corrupt stack?)"); + return NULL; + } /* 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 @@ -1199,7 +1205,8 @@ get_prev_frame (struct frame_info *this_ if (this_frame->level > backtrace_limit) { - error ("Backtrace limit of %d exceeded", backtrace_limit); + warning ("Backtrace limit of %d exceeded", backtrace_limit); + return NULL; } /* If we're already inside the entry function for the main objfile, --------------020809090504040107020105--