add-symbol-file

Greg 'groggy' Lehey grog at FreeBSD.org
Fri Sep 17 21:43:20 PDT 2004


[Format recovered--see http://www.lemis.com/email/email-format.html]

Important output wrapped.

On Friday, 17 September 2004 at 17:02:58 -0700, Jerry Toung wrote:
> Hello list,
> Could somebody tell me why I can't "list" the source code of this kld?
> I built the module with COPTS=-g, it is loaded in the kernel and I run kgdb in
> /usr/obj/...../MYKERNEL. Everything seems to go well, except kgdb still
> doesn't like it. However if I run kldsyms, it only loads acpi.ko.debug and I
> can list it.

It looks like you're not doing it the way it was intended.  As it
says:

> Type 'getsyms' after connection to load kld symbols.

This does the add-symbol-file for you.  Take a look at gdb(4) for more
details.

> If you're debugging a local system, you can use 'kldsyms' instead
> to load the kld symbols.  That's a less obnoxious interface.
> doadump () at pcpu.h:159
> (kgdb) add-symbol-file /usr/local/src/nren-6.0current/osr_src/if_osr.ko
> 0xc24b3184 -s .data 0xc24b6900 -s .bss 0xc24b6cc0

I'm assuming that this was broken by your MUA, and it's not the way
you put it in, which must have been:

> (kgdb) add-symbol-file /usr/local/src/nren-6.0current/osr_src/if_osr.ko 0xc24b3184 -s .data 0xc24b6900 -s .bss 0xc24b6cc0

Where did you get these addresses from?  They're all outside the
bounds of the kld as shown below.

> (kgdb) kldstat
> During symbol reading, Incomplete CFI data; unspecified registers at
> 0xc05ff7d1.
> Id Refs Address    Size     Name
>  1    4 0xc0400000 5d63e4   kernel
>  2   14 0xc09d7000 54784    acpi.ko
>  3    1 0xc2326000 6000     if_osr.ko

In any case, I'm not sure that you need getsyms any more.  It used to
be needed to get round various gdb restrictions.  What happens if you
don't do anything?  If that doesn't work, how about running getsyms,
as suggested?  Please let me know either way what happens.

Greg
--
When replying to this message, please take care not to mutilate the
original text.  
For more information, see http://www.lemis.com/email.html
See complete headers for address and phone numbers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040918/05f83103/attachment.bin


More information about the freebsd-hackers mailing list