BreakPoint Command Not found error

I have Suse linux-2.6.31.5-0.1.

When I try to set breakpoint in application or kernel modules it gives me command not found error.

For instance
when I typed the command
b xyz.c:47

it gives me an error:

"If 'b' is not a typo you can use command-not-found lookup the package that contains it, like this:
    cnf b"

When I fire cnf b it gives me an error:

b: command not found 

The output of # echo $PATH is as desired:
/usr/lib/mpi/gcc/openmpi/bin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin

How to rectify this issue?

You need to run that in a debugger, not outside a debugger. Shell doesn't understand what "b: whatever.c:242" means.

1 Like

Is this not specific to GDB debugger or perl? I have not heard of shell being able to nor as a command... (explaining perhaps the command not found message and that you cannot find it as a package...)

Coronna will you pls let me know how to debug linux kernel modules.
I have created and loaded(using insmod) a simple module having just init, exit ,read and write functions.
I have compiled the kernel with options "Compile the kernel with debug info" and �Compile the kernel with frame pointers".

To debug an application we attach the gdb to the pid of application's process and then set the breakpoints in code file.
But for a kernel module I am confused as how to proceed.
I want to know how to debug this kernel module.

Will you pls throw some light on it?

The kernel needs a different debugger, kdb. I'm not familiar with it, and it may not work the same way as you'd expect of gdb, but this article may help.

1 Like