From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27198 invoked by alias); 2 Oct 2007 20:43:28 -0000 Received: (qmail 27190 invoked by uid 22791); 2 Oct 2007 20:43:28 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 Oct 2007 20:43:25 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id C15C398152; Tue, 2 Oct 2007 20:43:23 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 67DE69810B; Tue, 2 Oct 2007 20:43:23 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IcoaQ-0001Lo-3u; Tue, 02 Oct 2007 16:43:22 -0400 Date: Tue, 02 Oct 2007 20:43:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: ringlej , 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) Message-ID: <20071002204322.GA5154@caradoc.them.org> Mail-Followup-To: Jim Blandy , ringlej , Jon Ringle , Jon Ringle , gdb@sourceware.org References: <4DD3AF7ECBBC43409BA36508938D01851B00AE@CVAEX1.VERTICAL.COM> <46FC7961.2080706@ringle.org> <46FD72CE.9080603@ringle.org> <20070929002707.GA6310@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-09) 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/msg00023.txt.bz2 On Tue, Oct 02, 2007 at 01:25:58PM -0700, Jim Blandy wrote: > 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. Oh yes. That's just a bug. Unfortunately it is approximately impossible to solve. I do not remember how this works out for kernel modules normally - maybe the answer is poorly. We have to apply relocations, or else fake it by looking at the slightly-relocated offsets (look at where we assign random VMAs to the sections of unlinked objects during loading). -- Daniel Jacobowitz CodeSourcery