Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 2017 17:01:15 -0400
From:      Farhan Khan <khanzf@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Debugging symbols on kernel module
Message-ID:  <e2def9e8-4356-2699-b127-e5e93ac11319@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi all,

I am working on a kernel module but am getting some unexpected code 
execution. Dtrace probes reveal that the kernel executes: 
"rtwn.ko`r88ee_init_bb+0x219" and then jumps to an unexpected function.

I would like to track down exactly which line that is. I compiled the 
module with this:

# make DEBUG_FLAGS=-g3 -C sys/modules/rtwn/

This produced the rtwn.ko.debug and rtwn.ko.full files. But when I load 
them, I still do not have debugging symbols:

$ kgdb rtwn.ko
GNU gdb (GDB) 8.0 [GDB v8.0 for FreeBSD]
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd12.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from rtwn.ko...Reading symbols from 
/usr/src/sys/modules/rtwn/rtwn.ko.debug...(no debugging symbols 
found)...done.
(no debugging symbols found)...done.
(kgdb) file rtwn.ko.debug
Reading symbols from rtwn.ko.debug...(no debugging symbols found)...done.
(kgdb) file rtwn.ko.full
Reading symbols from rtwn.ko.full...(no debugging symbols found)...done.

How do I properly load debugging symbols for the module?

Thanks,

Farhan Khan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e2def9e8-4356-2699-b127-e5e93ac11319>