Re: Not All Symbols Present in a Loadable Kernel Module



On Fri, May 2, 2008 at 8:06 PM, David Christensen <davidch@xxxxxxxxxxxx> wrote:
I'm trying to build the "bce" driver as a kernel module under
> RELENG_7 but I'm
> > finding that not all of the functions in the driver are exported as
> symbols. This
> > makes it difficult to "call" a function from ddb because I get the
> error "Symbol
> > not found". I'm building and loading the driver from
> /usr/src/sys/modules/bce.
> > What am I doing wrong? How can I get all functions in the driver
> exported as
> > symbols usable by the debugger?
>
> Are you building a debug kernel or regular kernel? Have you turned on
> debug symbols?
>
> makeoptions DEBUG=-g # Build kernel with gdb(1)
> debug symbols
>
> Just a quick thought...I'm assuming these symbols are listed under
> your final kernel image (nm it etc.).

Yes, I'm building a debug kernel. I have the line listed above as well
as the following:

options KDB
options DDB
options GDB
options INVARIANTS
options INVARIANT_SUPPORT
options WITNESS
options WITNESS_SKIPSPIN

Dave:

What symbols can you not access exactly and how are you
installing/setting up debugging?

I just built a RELENG_7 with DDB and I'm able to access bce symbols
without a problem. I can examine them and call them. I'm not using
options GDB however, only KDB/DDB.

I would:

- Make sure you have the right if_bce.ko/if_bce.ko.symbols files
generated/installed which contains the debug sections of your ko (from
the objcopy calls during the build - the binary is stripped with a
section pointer to the if_bce.ko.symbols file for debugging
information I believe)
- If you are using GDB, make sure its pointed to the right source base
so it can retrieve symbol information correctly
- If you are using GDB, stub it out and just use DDB to verify that
your build is sane (it works for me!)
- If all else fails, you can always build bce statically (just to move
forward etc.)

-aps
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • [RFC: 2.6 patch] remove the broken SCSI_SEAGATE driver
    ... But if anyone wants to ever revive this driver, ... * Will activate debug code. ... -static int internal_command (unsigned char target, unsigned char lun, ... -/* If the user specified the controller type from the command line, ...
    (Linux-Kernel)
  • [RFC: 2.6 patch] remove the broken SCSI_SEAGATE driver
    ... But if anyone wants to ever revive this driver, ... * Will activate debug code. ... -static int internal_command (unsigned char target, unsigned char lun, ... -/* If the user specified the controller type from the command line, ...
    (Linux-Kernel)
  • [2.6 patch] remove the broken SCSI_SEAGATE driver
    ... But if anyone wants to ever revive this driver, ... * Will activate debug code. ... -static int internal_command (unsigned char target, unsigned char lun, ... -/* If the user specified the controller type from the command line, ...
    (Linux-Kernel)
  • RE: freebsd-hackers Digest, Vol 200, Issue 7
    ... Updated Driver for 3945ABG Intel 3945ABG Wireless LAN ... sysctlinterface ... Jan 27 10:30:39 vaio kernel: bus_dmamem_alloc failed to align memory properly. ... debug: all: oid: 0 2 440 ...
    (freebsd-hackers)
  • RE: Bluetooth Obex Ftp Bcsp
    ... Can you please capture some debug output from the Bluetooth stack? ... should be able to see what was last happening in bthcsr before the transfer ... debug into this driver. ...
    (microsoft.public.windowsce.platbuilder)

Loading