From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19782 invoked by alias); 26 Oct 2004 13:29:30 -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 19757 invoked from network); 26 Oct 2004 13:29:29 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 26 Oct 2004 13:29:29 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CMRO8-00070c-PD; Tue, 26 Oct 2004 09:29:24 -0400 Date: Thu, 28 Oct 2004 13:49:00 -0000 From: Daniel Jacobowitz To: Felix Lee Cc: gdb list Subject: Re: backtrace changes current source location Message-ID: <20041026132924.GA26886@nevyn.them.org> Mail-Followup-To: Felix Lee , gdb list References: <20041026075115.4A2C354AAB5@stray.canids> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041026075115.4A2C354AAB5@stray.canids> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-10/txt/msg00419.txt.bz2 On Tue, Oct 26, 2004 at 12:51:15AM -0700, Felix Lee wrote: > after doing a backtrace, the current source location is set to > the last frame in the backtrace, which is often main(). this > doesn't seem like useful behavior. I think backtrace shouldn't > change the current source location at all, but it's been that way > since gdb 5.3. > > this is when the change happened: > http://sources.redhat.com/ml/gdb-patches/2002-08/msg00358.html > any time frame info gets printed, the current source location is > set to that frame, which seems reasonable to me, but it causes > this awkward backtrace behavior. > > maybe backtraces should be considered a special case, and > stack.c:backtrace_command_1 should save/restore the current > source location around the call to print_frame_info? I've been meaning to fix this since 6.0... I think your suggestion is reasonable; do you want to try it? -- Daniel Jacobowitz