[ILUG] Kernel Debugger
Sean
sean at binky.net
Fri Sep 8 01:36:15 IST 2000
Kenn Humborg wrote something:
{ On Thu, Sep 07, 2000 at 09:52:16AM +0100, Damian O'Sullivan wrote:
{ > I'd just love to know what the harm is in having a kernel debugger..
{
{ He thinks that it makes programmers lazy. He wants kernel hackers to
{ write obviously, provably, correct kernel code, not code that works
{ when you step through it.
{
{ He does have a point, to a certain degree. Once you start dealing with
{ SMP or asynchronous stuff like interrupts, no debugger is going to give
{ you an accurate picture of how the code will behave in the real world.
{ It's better to _think_ about every line of code and say 'What if I get
{ an interrupt _here_? What if another CPU does _that_ in between _these_
{ two lines of code?' and deal with all the horrible (albeit rare) cases
{ that arise. Paranoia rules. (I really wish more programmers understood
{ this...)
{
{ However, I think he goes a little overboard on this issue. He must have
{ known some luser coder during his formative years that leaned a bit too
{ heavily on a debugger without really understanding what the code was
{ doing. It's understandable, especially in these days where source-level
{ debuggers and IDEs make it _very_ easy to get lulled into a false sense
{ of security that the code will always behave the way it does in the
{ debugger. I've dealt with low-level debugging tools where it was pretty
{ much a toss-up as to whether it was quicker to learn the debugger or
{ to stick in a few debug printf()-equivalents and do a few
{ compile-boot-crash-reboot cycles :-)
Though there was the time when a printf statement would solve the problem,
remember the vms problems Kenn ?
That said, there are SMP machines with X processors (2 <= X <= 8)...
(anyone seen intel hardware handle more ?)
The machine hangs... and you don't know why... (no, it doesn't crash)
And the kernel debugger doesn't work with it, and its got loads of processes,
and you've got to track each process -> track each cpu -> impossible job.
(You go an try it then)
Wondering if its hardware (pc hardware => could be) or software...
Source level debugging is impossible. The most you hope for is to be
somehow able to dump the system, and look from there, whoa, the dump
partition isn't on a seperate disk, its shared with root (ya, stupid..),
it fails to dump... what then ?
(I haven't gone near an IDE type debugger in years, not knowing the
hardware is no excuse)
{
{ Later,
{ Kenn
{
Sean.
.
More information about the ILUG
mailing list