From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6610 invoked by alias); 11 Jul 2002 03:46:24 -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 6603 invoked from network); 11 Jul 2002 03:46:23 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 11 Jul 2002 03:46:23 -0000 Received: from dsl254-114-096.nyc1.dsl.speakeasy.net ([216.254.114.96] helo=nevyn.them.org) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17SUuI-0004ab-00; Wed, 10 Jul 2002 22:46:19 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17SUuJ-0005ux-00; Wed, 10 Jul 2002 23:46:19 -0400 Date: Thu, 11 Jul 2002 02:42:00 -0000 From: Daniel Jacobowitz To: Jim Ingham Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] Fix to processing end of function stab in dbxread.c Message-ID: <20020711034619.GA22631@nevyn.them.org> Mail-Followup-To: Jim Ingham , gdb-patches@sources.redhat.com References: <10111A6F-9473-11D6-AD3A-00039379E320@apple.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10111A6F-9473-11D6-AD3A-00039379E320@apple.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-07/txt/msg00223.txt.bz2 On Wed, Jul 10, 2002 at 07:08:16PM -0700, Jim Ingham wrote: > Index: dbxread.c > =================================================================== > RCS file: /cvs/src/src/gdb/dbxread.c,v > retrieving revision 1.33 > diff -c -w -r1.33 dbxread.c > *** dbxread.c 10 May 2002 07:32:50 -0000 1.33 > --- dbxread.c 11 Jul 2002 01:58:29 -0000 > *************** > Hi, all... > > Fred added an extra record_line call which closes off the last SLINE in > a function when we come across the end of function N_FUN stab. This > was a good thing, but unfortunately, he used function_start_offset, > which on most systems is just the offset to the TEXT section (the > exception being Solaris, where is actually is the real function start). > He really meant to use last_function_start, which is the real address > of the last N_FUN stab seen. > > I also fixed the comment before sline_found_in_function to accord with > its current usage, since the old comment is wrong. We set > sline_found_in_function = 0 at the same time we set > last_function_start, but then we set it to 1 when we see the FIRST > SLINE in a function, but last_function_start is still good after that. > And nobody ever checks it to see if they should use last_function_start > or not... Well, the archeology is hardly correct. I added both last_function_start and sline_found_in_function recently; last_function_start was because I couldn't convince myself that I could trust the other. Note that in the normal N_SLINE handling, we use function_start_offset and not last_function_start. So if your change was really correct then all the N_SLINEs for your function would be in the wrong places too. Could you please explain what problem you're trying to fix, and support it with some stabs dumps? > > *** 2761,2768 **** > static CORE_ADDR last_function_start; > > /* If this is nonzero, we've seen an N_SLINE since the start of the > current > ! function. Initialized to nonzero to assure that > last_function_start > ! is never used uninitialized. */ > static int sline_found_in_function = 1; > > /* If this is nonzero, we've seen a non-gcc N_OPT symbol for this > source > --- 2761,2768 ---- > static CORE_ADDR last_function_start; > > /* If this is nonzero, we've seen an N_SLINE since the start of the > current > ! function. We use this to tell us to move the first sline to the > beginning > ! of the function regardless of what its given value is. */ > static int sline_found_in_function = 1; > > /* If this is nonzero, we've seen a non-gcc N_OPT symbol for this > source > *************** > *** 2799,2805 **** > { > /* This N_FUN marks the end of a function. This closes off > the > current block. */ > ! record_line (current_subfile, 0, function_start_offset + > valu); > within_function = 0; > new = pop_context (); > > --- 2799,2805 ---- > { > /* This N_FUN marks the end of a function. This closes off > the > current block. */ > ! record_line (current_subfile, 0, last_function_start + valu); > within_function = 0; > new = pop_context (); > > Jim > -- > Jim Ingham jingham@apple.com > Developer Tools - gdb > Apple Computer > > -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer