From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32146 invoked by alias); 25 Aug 2004 19:49:57 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 32135 invoked from network); 25 Aug 2004 19:49:55 -0000 Received: from unknown (HELO cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com) (81.105.116.12) by sourceware.org with SMTP; 25 Aug 2004 19:49:55 -0000 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com (8.12.11/8.12.11) with ESMTP id i7PK7CEl025108 for ; Wed, 25 Aug 2004 21:07:12 +0100 Subject: [RFC] Backtrace limit From: David Lecomber To: gdb@sources.redhat.com In-Reply-To: <1092744111.3127.25.camel@cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com> References: <1092744111.3127.25.camel@cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com> Content-Type: text/plain Message-Id: <1093464432.11753.12.camel@cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com> Mime-Version: 1.0 Date: Wed, 25 Aug 2004 19:49:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00377.txt.bz2 I've just filed a bug (1790) and done some investigation into the backtrace limit variable. Essentially the limiting doesn't work: set it to 10, and it always claims to be true. The culprit is that the type of frame->level is int, and the type of backtrace_limit is uint. This wouldn't be a problem except that there is always a frame with level -1 (it seems to be the 0 level-frame when printed out). So, the non-elegant fix is: RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.190 diff -c -p -r1.190 frame.c *** frame.c 2 Aug 2004 03:36:24 -0000 1.190 --- frame.c 25 Aug 2004 19:48:30 -0000 *************** get_prev_frame (struct frame_info *this_ *** 1179,1185 **** return NULL; } ! if (this_frame->level > backtrace_limit) { error ("Backtrace limit of %d exceeded", backtrace_limit); } --- 1179,1186 ---- return NULL; } ! if (this_frame->level != -1 && ! (unsigned int) this_frame->level > backtrace_limit) { error ("Backtrace limit of %d exceeded", backtrace_limit); But I'm open to suggestions involving making backtrace_limit a signed int. Any comments? Cheers David