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]

special symbol file address -1: debug lin-kern mods


Hi,

I have been trying to get gdb working at loading linux kernel modules via
'add-symbol-file'. Since it doesn't work properly with gdb, I tried to patch
gdb but in vein ( 'regression caused by elfread.c patch' thread ).

I had patched gdb 4.18 before I started using current gdb. The patch disabled
relocations if symbol file load address was -1.

e.g. add-symbol-file foo.reloc -1 
loads foo.reloc without relocating. Where foo.reloc is built from linux kernel
module foo using ld.

ld -o foo.reloc -Ttext< module text address> -Tdata<module data address>
-Tbss<module bss address> -R vmlinux -noinhibit-exec foo

How about adding this feature in gdb?
Thanks.
-- 
Amit Kale
Veritas Software ( http://www.veritas.com )


P.S. Above mentions patch for gdb-4.18 was as follows
diff -Naur gdb-4.18/gdb/symfile.c gdb/gdb/symfile.c
--- gdb-4.18/gdb/symfile.c	Thu Feb 11 05:54:38 1999
+++ gdb/gdb/symfile.c	Mon Dec 27 16:15:56 1999
@@ -525,7 +525,7 @@
      and assume that <addr> is where that got loaded.  Due to historical
      precedent, we warn if that doesn't happen to be a text segment.  */
 
-  if (mainline)
+  if (mainline || addr == -1)
     {
       addr = 0;		/* No offset from objfile addresses.  */
     }

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