No line number info debugging kernel modules with gdb 6.6.90.20070926-cvs (gdb 6.7 branch)
Daniel Jacobowitz
drow@false.org
Tue Oct 2 20:43:00 GMT 2007
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
More information about the Gdb
mailing list