special symbol file address -1: debug lin-kern mods
Amit S. Kale
akale@veritas.com
Tue Mar 14 00:17:00 GMT 2000
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. */
}
More information about the Gdb
mailing list