Re: No line number info debugging kernel modules with gdb 6.6.90.20070926-cvs (gdb 6.7 branch)

Jim Blandy
2007-10-02T20:26:06Z

Daniel Jacobowitz <drow at false.org> 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.