Date: Tue, 28 May 2002 17:47:05 +0200 (CEST) From: Nick Hibma <n_hibma@van-laarhoven.org> To: Mark Peek <mp@FreeBSD.org> Cc: FreeBSD CURRENT Mailing List <current@FreeBSD.ORG> Subject: Re: gdb52 patch for your .gdbinit files Message-ID: <20020528174441.U231-200000@heather.van-laarhoven.org> In-Reply-To: <p05111708b91944b81877@[10.1.1.198]>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Doh! me bad, I didn't include an example:
The attached .gdbinit loads the symbols from a module, but needs the
start address of the .text section.
add-symbol-file filename address
address cannot be an expression in gdb5.2, just a simple address
('0x[0-9a-f]+' or '[0-9]+').
Nick
On Tue, 28 May 2002, Mark Peek wrote:
> At 3:54 PM +0200 5/28/02, Nick Hibma wrote:
> >I'm using a derivative of the .gdbinit.vinum files that is available in
> >the modules/vinum directory. For them to work the following patch is
> >needed in gdb52.
> >
> >As you can see, the patch is trivial, so I have no clue why this wasn't
> >left alone when they modified symfile.c. If I can be bothered I'll
> >submit it to them.
> >
> >Nick
> >
> >
> ># diff -wu gdb-5.2/gdb/symfile.c~ gdb-5.2/gdb/symfile.c
> >--- gdb-5.2/gdb/symfile.c~ Tue May 28 15:51:37 2002
> >+++ gdb-5.2/gdb/symfile.c Tue May 28 15:51:06 2002
> >@@ -1546,11 +1546,15 @@
> > char *val = sect_opts[i].value;
> > char *sec = sect_opts[i].name;
> >
> >+#ifdef 0
> > val = sect_opts[i].value;
> > if (val[0] == '0' && val[1] == 'x')
> > addr = strtoul (val+2, NULL, 16);
> > else
> > addr = strtoul (val, NULL, 10);
> >+#else
> >+ addr = parse_and_eval_address(val);
> >+#endif
> >
> > /* Here we store the section offsets in the order they were
> > entered on the command line. */
>
>
> Nick,
> Could you send me the relevant lines from your .gdbinit that exhibit
> this problem? I'd like to understand why the above patch to gdb is
> necessary.
>
> Thanks!
> Mark
>
--
n_hibma@van-laarhoven.org http://www.van-laarhoven.org/
n_hibma@FreeBSD.org http://www.etla.net/~n_hibma/
[-- Attachment #2 --]
define umass
set $file = linker_files.tqh_first
set $found = 0
while ($found == 0 && $file != 0)
if ($file->filename[0] == 'u' &&$file->filename[1] == 'm' &&$file->filename[2] == 'a' &&$file->filename[3] == 's' &&$file->filename[4] == 's' &&$file->filename[5] == '.' && $file->filename[6] == 'k')
set $found = 1
else
set $file = $file->link.tqe_next
end
end
if ($found == 0)
echo umass not found in linker_files.\n
else
echo file=
print $file
shell /usr/bin/objdump --section-headers /usr/obj/usr/src-current/sys/HEIDI/modules/usr/src-current/sys/modules/umass/umass.ko.debug | grep ' .text' | awk '{print "add-symbol-file /usr/obj/usr/src-current/sys/HEIDI/modules/usr/src-current/sys/modules/umass/umass.ko.debug \$file->address+0x" $4}' > /tmp/asf.umass
shell cat /tmp/asf.umass
source /tmp/asf.umass
#shell /bin/rm /tmp/asf.umass
end
end
document umass
Find the load address of umass in the kernel and add the symbols at this address
end
umass
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020528174441.U231-200000>
