Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Sep 2004 14:13:16 +0930
From:      Greg 'groggy' Lehey <grog@FreeBSD.org>
To:        Jerry Toung <jtoung@arc.nasa.gov>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: add-symbol-file
Message-ID:  <20040918044315.GE67689@wantadilla.lemis.com>
In-Reply-To: <200409171702.58905.jtoung@arc.nasa.gov>
References:  <200409171702.58905.jtoung@arc.nasa.gov>

next in thread | previous in thread | raw e-mail | index | archive | help

--10jrOL3x2xqLmOsH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

[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=3D-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 an=
d 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 0=
xc24b3184 -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. =20
For more information, see http://www.lemis.com/email.html
See complete headers for address and phone numbers.

--10jrOL3x2xqLmOsH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)

iD8DBQFBS7zjIubykFB6QiMRAp8kAJ9I/CjGn+fs0sgyI4XgucJbqxi62ACffjY5
tjnij7PkWHCGY/KXAhNeqTg=
=Hr7y
-----END PGP SIGNATURE-----

--10jrOL3x2xqLmOsH--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040918044315.GE67689>