Hi Vishal,
After setting up the testbed, to remotely (serially) debug the kernel
and then applying the breakpoints, kernel execution does not stop at
the breatpoint.
Below are the steps :
I compiled the kernel 2.6.8 after applying the kgdb patch and made a
set up to remotely debug the kernel mdule. I used gdbmod (available at
http://kgdb.linsyssoft.com) on development machine to connect to the
target machine as shown below.
/*********************************************************************/
[root@vishalsoni linux-2.6.8]# gdbmod vmlinux
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
breakpoint () at kernel/kgdb.c:1212
1212 atomic_set(&kgdb_setting_breakpoint, 0);
(gdb)
/*********************************************************************/
To let GDB know where module files are located, i set GDB variable
solib-search-path
/*********************************************************************/
(gdb) set solib-search-path /home/vishal/products/tot_driver/
/*********************************************************************/
and then i did insmod on target to load the kernel module and checked
the output of /proc/modules
Don't load the module directly in the taget. Download the script
loadmodule.sh script from the
site http://kgdb.linsyssoft.com then from the development m/c do
#./loadmodule x.x.x.x module.o
Where x.x.x.x is the ip address of your target and module.o is the module
you want to debug.
This will generate a script file(say /tmp/x.x.x.xmodule.o). Then at the
debug prompt do
#source /tmp/x.x.x.xmodule.o. This will add all the symbol files for your
module.
Now you will be able to add brk point at functions, line nos etc.
This how it's done in 2.4 kernel, in 2.6 it may not be very diffrent.
Hope this will solve your problem.
.Thanks,
Saumendra
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/