2

I wanted to know what an API is returning in a kernel module < vnos-module.ko>.

Go to know from few forms that it is not that straight forward, we need to load the symbol table to debug a kernel module.

So all I did is, 1. tried to find .text .bss and .data section address of the kernel module. 2. Add symbol table file using add-symbol-file command in gdb.

But I get error saying "Reading symbols from /fabos/modules/vnos-module.ko...(no debugging symbols found)...done."

is there anything I am missing here?

root@sw0:/sys/module/vnos_module/sections# cat .text .data .bss 
0xf7f7f000
0xf7fb7a30
0xf7fc3da4

root@sw0:/sys/module/vnos_module/sections# gdb /fabos/modules/vnos-module.ko
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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 "i686-linux-gnu".
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 /fabos/modules/vnos-module.ko...(no debugging symbols found)...done.
 add-symbol-file /fabos/modules/vnos-module.ko 0xf7f7f000 -s .data 0xf7fb7a -s .bss 0xf7fc3da4
add symbol table from file "/fabos/modules/vnos-module.ko" at
        .text_addr = 0xf7f7f000
        .data_addr = 0xf7fb7a30
(y or n) y

Reading symbols from /fabos/modules/vnos-module.ko...(no debugging symbols found)...done.

Please help.

Shravan Hebbar
  • 199
  • 1
  • 7
  • [Another question](http://stackoverflow.com/questions/38431060/debug-a-linux-kernel-module-using-gdb) looks the very same and asked 2 minutes before your one. If one of the question is asked by error, just delete it. – Tsyvarev Jul 18 '16 at 08:21

0 Answers0