This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Regression caused by elfread.c patch


   From: "Amit S. Kale" <akale@veritas.com>
   Date: Tue, 15 Feb 2000 16:27:31 +0530

   Hi,

   The problem due to which I patched elfread.c is as follows: Linux
   kernel modules are loaded using insmod which uses its own
   relocation scheme.  If we load a module file in gdb using
   add-symbol-file and specify .text address only, addresses of
   symbols in .data and .bss sections are calculated incorrectly.

   [snip]

   Can anyone guess the problem?

Yes, GDB basically supports only "flat" ELF objects, where all
addresses are supposed to be relative to a single offset (there is
some support for Sun STABS extensions though, don't know if that still
works).  The patch you sent might work, but not without additional
work.  You'll need to set up the offsets in an appropriate way first,
and see how this interacts with how GDB uses those offsets and how the
various debugging formats use them.

So for now debugging Linux kernel modules is not really supported.
Somebody needs to put a serious effort in it to make this work, which
probably isn't going to happen unless you can find a volunteer.

Mark

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]