From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15189 invoked by alias); 23 Feb 2006 18:40:21 -0000 Received: (qmail 15178 invoked by uid 22791); 23 Feb 2006 18:40:21 -0000 X-Spam-Check-By: sourceware.org Received: from mail.cae.wisc.edu (HELO mail.cae.wisc.edu) (144.92.13.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Feb 2006 18:40:20 +0000 Received: from [128.104.187.108] (rincewind.neep.wisc.edu [128.104.187.108]) by mail.cae.wisc.edu (8.13.4/8.13.4) with ESMTP id k1NIeBjd019977 for ; Thu, 23 Feb 2006 12:40:11 -0600 (CST) Message-ID: <43FE018B.2050502@cae.wisc.edu> Date: Thu, 23 Feb 2006 18:45:00 -0000 From: Jason Kraftcheck User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: list/edit command on frame with available symtab Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-CAE-MailScanner-Information: Please contact security@engr.wisc.edu if this message contains a virus or has been corrupted in delivery. X-CAE-MailScanner: Found to be clean (benji) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00435.txt.bz2 If there is no symtab for the current frame, traverse up the stack looking for a frame with a symtab. This may at first seem like a gratuitous feature (and perhaps it is), but I find it is convenient when working with an application that uses third-party libraries. Typically whatever code I'm working on has debug symbols while whatever third-party code I'm calling does not. And I'm much more interested in seeing where the process was in my code at the time a fault occurred. I don't think this change will be a problem for anyone, as the previous behavior was to print an error if there was no symtab. 2006-02-23 Jason Kraftcheck * stack.c (set_current_sal_from_frame): If list or edit command is invoked for a frame without a symtab, move up the stack to the neareast frame with a symtab. diff -upr gdb-6.4/gdb/stack.c mod/gdb/stack.c --- gdb-6.4/gdb/stack.c 2005-08-18 08:26:41.000000000 -0500 +++ mod/gdb/stack.c 2006-02-23 11:55:12.481291546 -0600 @@ -377,8 +377,18 @@ static void set_current_sal_from_frame (struct frame_info *frame, int center) { struct symtab_and_line sal; + int count; find_frame_sal (frame, &sal); + while (!sal.symtab) + { + count = 1; + frame = find_relative_frame( frame, &count ); + if (count) + break; + find_frame_sal (frame, &sal); + } + if (sal.symtab) { if (center)