02-12-2012
Debugging Linux Kernel Modules
I am aware of debugging linux applications using gdb and ddd.
Now I have written a simple kernel module having init_module, exit _module and some functions for tasklets and workqueues.
I want to debug these kernel modules like I used to debug applications setting breakpoints etc.
How can I debug linux kernel modules?
How to attach gdb to the modules and how to set breakpoints in them?
9 More Discussions You Might Find Interesting
1. SuSE
I'm using SuSE 9.2 Pro and trying to use a program call BestCrypt. I get it installed and type bctool and it says "Kernel modules not loaded". If you need to know anymore about it you can find it at http://www.jetico.com/linux/bcrypt-help/index.htm
linux:/home/chris/Desktop/Xtheater-0.9.2 #... (6 Replies)
Discussion started by: CTroxtell21
6 Replies
2. HP-UX
Hi all,
what do kernel modules libaudit, klog and strlog do?
Specifically I want to determine if it was possible for us to determine if kernel level auditing is enabled at all?
regards (0 Replies)
Discussion started by: slash_blog
0 Replies
3. UNIX for Advanced & Expert Users
I installed in VM the Mandriva Linux with 2.6.27 kernel.
But presently when I fire make the modules .ko does not get built.
I get the following output on firing command in the kernel module folder.
$ make
Building first_driver.c ... make: Entering directory... (1 Reply)
Discussion started by: rupeshkp728
1 Replies
4. Emergency UNIX and Linux Support
Hi,
I need to set qlogic qla2xxx parameters in /etc/modprobe.conf
(Oracle Linux Server release 5.7, almost equal to RedHat 5.7)
two questions:
how can I pass this parameters to the module while it is loaded (fibre channel luns are in use), if possible at all
and how can I check the... (3 Replies)
Discussion started by: funksen
3 Replies
5. UNIX for Dummies Questions & Answers
This query is regarding the makefiles of linux kernel modules.
I saw at some sites on net it is suggesting to include the following path:
KERNEL_SOURCE := /usr/src/linux...
while at some places it is askibg to include /lib/modules path:
KERNEL_SOURCE := /lib/modules/2.6.27-7-generic/build... (0 Replies)
Discussion started by: rupeshkp728
0 Replies
6. UNIX for Advanced & Expert Users
Question may seem illogical but I still need clarification.
Can we debug kernel modules loaded on my target system using kdb / kgdb without using any other system or remote debugging?
In other words my question is can we use kdb/kgdb to debug kernel modules running on same system? (2 Replies)
Discussion started by: rupeshkp728
2 Replies
7. Hardware
Hey everyone. I have a question, doing an lsmod gives me a list of all the loaded modules for my system. But how did they know to load? my /etc/modules files is empty, so how did these modules know to load themselves on boot time? If I were to take this hard drive to another computer with a... (6 Replies)
Discussion started by: Lost in Cyberia
6 Replies
8. Linux
Hi,
I am running CentOS 6.5 and I want to remove auto loading 8021q and garp modules, but there are no configure files in /etc/modprobe.d define bot modules.
I even added both module names to /etc/modprobe.d/blacklist.conf, both of them are still loaded after the reboot. How can I disable... (2 Replies)
Discussion started by: hce
2 Replies
9. UNIX for Beginners Questions & Answers
I'm a little embarrassed after all these years I've never really successfully compiled my own kernel. I used this guide to make the following files:
linux-headers-5.1.9_5.1.9-1_amd64.deb
linux-image-5.1.9_5.1.9-1_amd64.deb
linux-libc-dev_5.1.9-1_amd64.deb
When I first booted into this... (4 Replies)
Discussion started by: Azrael
4 Replies
KDBG(1) General Commands Manual KDBG(1)
NAME
kdbg - a graphical debugger interface
SYNOPSIS
kdbg [ generic-options ] [ -t file ] [ -r device ] [ -l language ] [ -p pid ] [ program ] [ core ]
DESCRIPTION
KDbg is a graphical user interface to gdb, the GNU debugger. It provides an intuitive interface for setting breakpoints, inspecting vari-
ables, stepping through code and much more. KDbg requires KDE but you can of course debug any program.
KDbg can also debug XSLT (XML stylesheet translation) scripts by interfacing with xsldbg. Debian users must install the kxsldbg package to
make use of this feature.
You can pass KDbg the path of the executable to debug (program) or a core dump to debug (core).
Features of KDbg include:
Inspection of variable values in a tree structure.
Direct member: For certain compound data types the most important member values are displayed next to the variable name, so that it
is not necessary to expand the subtree of that variable in order to see the member value. KDbg can also display Qt's QString val-
ues, which are Unicode strings.
Debugger at your finger tips: The basic debugger functions (step, next, run, finish, until, set/clear/enable/disable breakpoint) are
bound to function keys F5 through F10. Quick and easy.
View source code, search text, set program arguments and environment variables, display arbitrary expressions.
Debugging of core dumps, attaching to running processes is possible.
Conditional breakpoints.
OPTIONS
Below are the kdbg-specific options. For a full summary of options, run kdbg --help.
-t file
Write a transcript of the conversation with the debugger to the given file.
-r device
Use remote debugging via the given device.
-l language
Specify the language of the program/script to debug. This must be either C (for a C/C++ program) or XSL (for an XSLT script). If
this option is not passed then KDbg will try to deduce the language from the given filename.
-p pid Attach to the process with the given process ID.
SEE ALSO
gdb(1), xsldbg(1).
Full user documentation is available through the KDE Help Centre. Alternatively the HTML documentation can be viewed directly from
/usr/share/doc/kdbg/html/.
AUTHOR
KDbg was written by Johannes Sixt <Johannes.Sixt@telecom.at>.
This manual page was prepared by Ben Burton <bab@debian.org> for the Debian GNU/Linux system (but may be used by others).
March 25, 2005 KDBG(1)