From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9131 invoked by alias); 11 Jul 2002 21:10:54 -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 8976 invoked from network); 11 Jul 2002 21:10:51 -0000 Received: from unknown (HELO mail-out2.apple.com) (17.254.0.51) by sources.redhat.com with SMTP; 11 Jul 2002 21:10:51 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out2.apple.com (8.11.3/8.11.3) with ESMTP id g6BLApA15127 for ; Thu, 11 Jul 2002 14:10:51 -0700 (PDT) Received: from scv1.apple.com (scv1.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Thu, 11 Jul 2002 14:10:12 -0700 Received: from inghji.apple.com (inghji.apple.com [17.201.22.240]) by scv1.apple.com (8.11.3/8.11.3) with ESMTP id g6BLAol25039; Thu, 11 Jul 2002 14:10:50 -0700 (PDT) Date: Thu, 11 Jul 2002 16:40:00 -0000 Subject: Re: [patch] Fix to processing end of function stab in dbxread.c Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v533) Cc: gdb-patches@sources.redhat.com To: Daniel Jacobowitz From: Jim Ingham In-Reply-To: <20020711184252.GA29207@nevyn.them.org> Message-Id: Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00256.txt.bz2 Daniel, On Thursday, July 11, 2002, at 11:42 AM, Daniel Jacobowitz wrote: > > You've switched functions. That code is in read_dbx_symtab. There was > no variable in process_one_symbol by that name until quite recently. > They do have the same meaning however. That's what I meant about your > archeology being wrong. The comment that function_start_offset is > only correct for Solaris is also wrong; I can verify that it is correct > on GNU/Linux. That's not your fault, though, the comments in dbxread.c > range from mediocre to misleading. What comments referencing Solaris 2 > (rather than referencing something about Sun's lame tools) often > mean is "on SVR4-ish systems". > Okay... > I judge from your example that MacOSX has resolved addresses attached > to N_SLINE stabs, but not in ending N_FUN stabs? GDB assumes that > function_start_offset applies to both of them equally (and it will be > zero if we expect both to be resolved). On GNU/Linux both N_SLINE and > final N_FUN have offsets within the function. I suspect that on some > Solaris variant N_SLINE and final N_FUN will both have resolved values. > In that case using last_function_start + valu will put us well outside > of the actual function, causing mayhem. That's right. MacOS X's linker does fix up the SLINE stabs, but it does what stabs.texi says to do with the end of function stabs. It would suprise me if there were a Solaris compile/linker that does otherwise with the end of FUN stab. After all, it seems like the Solaris tools go out of their way to avoid having STABS that the linker has to fix up. Also, the comment in stabs.texi says "Recent versions of GCC will mark the end of the function with an N_FUN symbol..." Sounds like the Solaris compilers may not have this end of function FUN stab at all. Would somebody with access to a Solaris box with acc on it compile a simple program with "-g" and see if it has this stab, and if so what its value is? I bet the code I suggested will work fine. Jim -- Jim Ingham jingham@apple.com Developer Tools - gdb Apple Computer