From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8099 invoked by alias); 6 Apr 2006 04:30:48 -0000 Received: (qmail 8085 invoked by uid 22791); 6 Apr 2006 04:30:47 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 06 Apr 2006 04:30:46 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FRM8p-0004K2-Lz; Thu, 06 Apr 2006 00:30:43 -0400 Date: Thu, 06 Apr 2006 05:06:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org, gdb@sources.redhat.com Subject: Re: text file formats Message-ID: <20060406043043.GB16513@nevyn.them.org> Mail-Followup-To: gdb@sourceware.org, gdb@sources.redhat.com References: <20060405223122.GB11610@brasko.net> <20060405233938.GA11013@nevyn.them.org> <20060406001455.GC11610@brasko.net> <20060406011732.GA12814@nevyn.them.org> <20060406032702.GE11610@brasko.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00052.txt.bz2 On Thu, Apr 06, 2006 at 06:35:41AM +0300, Eli Zaretskii wrote: > > Does the debug info actually say, "at line 100 symbol foo() exists?" > > No, it says, for every source line, which PC addresses correspond to > that source line. That is all GDB needs to know, because it > manipulates PC addresses (i.e. addresses in the .text section). > > For symbols, the debug info says that symbol `foo' is stored in the > .text or .data section (or .bss or something else) at address NNN. Well, this is true, but what Bob wrote is often true also. One of them is the line corresponding to the first PC instruction of the function; the other is the line of declaration of the function, which may be different (e.g. before the leading brace). I don't remember offhand if GDB takes advantage of the latter. (One comes from DWARF .debug_line, the other from .debug_info DW_AT_decl_line). -- Daniel Jacobowitz CodeSourcery From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8102 invoked by alias); 6 Apr 2006 04:30:48 -0000 Received: (qmail 8086 invoked by uid 22791); 6 Apr 2006 04:30:47 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 06 Apr 2006 04:30:46 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FRM8p-0004K2-Lz; Thu, 06 Apr 2006 00:30:43 -0400 Date: Thu, 06 Apr 2006 13:03:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org, gdb@sources.redhat.com Subject: Re: text file formats Message-ID: <20060406043043.GB16513@nevyn.them.org> Mail-Followup-To: gdb@sourceware.org, gdb@sources.redhat.com References: <20060405223122.GB11610@brasko.net> <20060405233938.GA11013@nevyn.them.org> <20060406001455.GC11610@brasko.net> <20060406011732.GA12814@nevyn.them.org> <20060406032702.GE11610@brasko.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00053.txt.bz2 Message-ID: <20060406130300.PmA88Kfrrlktc5D2oTHz1KEVYWF_T3ax6W9MsRHPJds@z> On Thu, Apr 06, 2006 at 06:35:41AM +0300, Eli Zaretskii wrote: > > Does the debug info actually say, "at line 100 symbol foo() exists?" > > No, it says, for every source line, which PC addresses correspond to > that source line. That is all GDB needs to know, because it > manipulates PC addresses (i.e. addresses in the .text section). > > For symbols, the debug info says that symbol `foo' is stored in the > .text or .data section (or .bss or something else) at address NNN. Well, this is true, but what Bob wrote is often true also. One of them is the line corresponding to the first PC instruction of the function; the other is the line of declaration of the function, which may be different (e.g. before the leading brace). I don't remember offhand if GDB takes advantage of the latter. (One comes from DWARF .debug_line, the other from .debug_info DW_AT_decl_line). -- Daniel Jacobowitz CodeSourcery