From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21764 invoked by alias); 2 Oct 2007 20:26:06 -0000 Received: (qmail 21740 invoked by uid 22791); 2 Oct 2007 20:26:05 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 Oct 2007 20:26:00 +0000 Received: (qmail 21546 invoked from network); 2 Oct 2007 20:25:59 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 Oct 2007 20:25:59 -0000 To: ringlej Cc: Jon Ringle , Jon Ringle , gdb@sourceware.org Subject: Re: No line number info debugging kernel modules with gdb 6.6.90.20070926-cvs (gdb 6.7 branch) References: <4DD3AF7ECBBC43409BA36508938D01851B00AE@CVAEX1.VERTICAL.COM> <46FC7961.2080706@ringle.org> <46FD72CE.9080603@ringle.org> <20070929002707.GA6310@caradoc.them.org> From: Jim Blandy Date: Tue, 02 Oct 2007 20:26:00 -0000 In-Reply-To: <20070929002707.GA6310@caradoc.them.org> (Daniel Jacobowitz's message of "Fri, 28 Sep 2007 20:27:07 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00022.txt.bz2 Daniel Jacobowitz writes: > On Fri, Sep 28, 2007 at 04:49:43PM -0700, Jim Blandy wrote: >> Okay. Some of the line table entries have been relocated into the >> module's actual range (0xbf13100 on up), but others still look to me >> like offsets within the .ko. Can you post the output from running >> 'readelf -wil' on your .ko file? > > add-symbol-file doesn't relocate everything. You have to give it a > separate value for every section. Where does this relocation happen? By the time PSYMTAB_TO_SYMTAB returns the job should be done; all I see happening in dwarf2read.c or end_symtab is: baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); and then that gets applied to everything. For variables we do consult other section offsets, but not for lines or functions.