This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Multiple breakpoint issue when debugging loadable kernel module
- From: Vimal <j dot vimal at gmail dot com>
- To: gdb at sourceware dot org
- Date: Sun, 23 Oct 2011 20:16:10 -0600
- Subject: Multiple breakpoint issue when debugging loadable kernel module
Hi,
I have a loadable kernel module, and I am facing issues when setting
breakpoints.
I am using gdb 7.3.1 from ftp://ftp.gnu.org/gnu/gdb.
1. I start the kernel under qemu-kvm and load the kernel module. The
kernel module was compiled with CFLAGS=-O0 -g
2. I generate the add-symbol-path command by using section address
information from /sys/module/$mod/sections/.*
3. I enter the add-symbol-path command into gdb, which is connected to
qemu's gdb stub via "target remote" command.
4. After loading the symbols, I do: "info line function" and am able
to see the function name's line number. Also, "list function" shows
the source code from the correct file.
5. I do "break function", I see this message:
Breakpoint 1 at address (2 locations)
After the last step, if I run "info line function", I see "No line
number information available for address..."
When I type "info break", I see the two breakpoints inserted at
"function+4" and "function+31".
This error does not happen in gdb-7.1. The reason I am using
gdb-7.3.1 is that I want to use gdb.Breakpoint from a python script.
Is there a way to fix this error? Why are two breakpoints being set?
This error happens across a few kernel modules that I tested.
Thanks,
--
Vimal