This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: No line number info debugging kernel modules with gdb 6.6.90.20070926-cvs (gdb 6.7 branch)
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jim Blandy <jimb at codesourcery dot com>
- Cc: ringlej <ringlej at ringle dot org>, Jon Ringle <jon at ringle dot org>, Jon Ringle <JRingle at vertical dot com>, gdb at sourceware dot org
- Date: Tue, 2 Oct 2007 16:43:22 -0400
- 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> <m3d4w3lkkb.fsf@codesourcery.com> <46FC7961.2080706@ringle.org> <m3odfmqysb.fsf@codesourcery.com> <46FD72CE.9080603@ringle.org> <m3ejgie4fc.fsf@codesourcery.com> <20070929002707.GA6310@caradoc.them.org> <m3odfhxnzd.fsf@codesourcery.com>
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