l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2002 May 23 19:01

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Kernel debugger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Kernel debugger


aside from jeff and rod's excellent suggestions (whoa!), here's some

depending on what you're debugging, and the details, you may want to use
a combination of /proc files and printk()'s.   i think you'll find it
**much** easier for simple debugging purposes.  all the debuggers i know
of require kernel patches and wierd serial connections.  printk() and in
particular, /proc, are easy to use and available immediately.

nota bene with using printk in tight loops:

if your code has some tight loops which you want to debug by printk, go
to /etc/syslog.conf and put the name of your log file with a "-" in
front of it so that printk doesn't keep syncing the disk (which is the
default behavior and the right thing to do from syslog's point of view,
but can be a nuisance from a coder's point of view).  the issue is that
a sync for every printk() can slow your system down.  this won't be a
problem for most code, though.  this is also why /proc is a good thing
to use for debugging -- no disk access at all.

i once read that the reason why the linux kernel doesn't contain an
internal interactive debugger is because linus doesn't believe in
debuggers.  his point of view is that fixing code using a debugger is
more of a "fix the symptom" type of programming rather than "addressing
the real cause of the problem.  this is word of mouth from alessandro
rubini, a prominent kernel hacker.  pretty wacky if you ask me, but who
am i to argue kernel programming with linus?  i'd just as soon argue
programming with knuth.

i've never used an kernel debugger, but i've read about them...

there are a few options that i know of:

kdb - a non-official interactive debugger.  widely used.
IKD - interactive kernel debugger.  this is a kernel patch that embeds a
  kernel debugger.
kgdb patch - don't know much about this, but apparently it allows you to
  use plain old gdb on a kernel.  i think you need to use it over a
  serial line, which makes it kind of wonky.

hope something in here was useful...

pete (who should be doing physics right now...)

begin Nicole Carlson <nmcarlson@ucdavis.edu> 
> Hi guys
> Can anyone recommend a good kernel debugger?  I have module code to debug.
> Thanks
> --nicole twn
> ***
> "This is a very hard class.  The projects are hard.  The homeworks are
> hard.  You should all drop this class."--my networks professor
> Visit Nicolopolis! http://wwwcsif.cs.ucdavis.edu/~carlsonn
> nmcarlson@ucdavis.edu ana.ng@tmbg.org carlsonn@seclab.cs.ucdavis.edu
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.