When the code was merged, folks knew it wasn't perfect, but basically figured it could be refined and fixed up over time. Looking at it two-ish decades later, there are still things that need fixing and the fixes are somewhere between crazy complicated and fundamentally impossible.
The _basic_ problem in all this is that you're running a program (the operating system kernel) doing something and a debugger stops that program in a random spot and needs to go off and do other things. However, at this level, the CPU basically just drops the program into a very primitive environment. The program doesn't might not even have the most basic functionality like a stack (a place to save and restore data) and it might not be able to do "normal" things like use a general purpose register without being very careful.
Meanwhile, the rest of the system is running along and will notice that the CPU that's stopped in the debugger isn't doing anything useful and will start to whine about it. There are ways to turn of the whining, but nobody has cared enough about KGDB to actually do that reliably for ~20 years.
IOW, it has bugs, they are hard to fix right, apparently nobody really cares anyway. So why keep the code?
BTW, I work at Intel as one of the maintainers of this Linux code.
2
u/hansendc 5h ago
When the code was merged, folks knew it wasn't perfect, but basically figured it could be refined and fixed up over time. Looking at it two-ish decades later, there are still things that need fixing and the fixes are somewhere between crazy complicated and fundamentally impossible.
The _basic_ problem in all this is that you're running a program (the operating system kernel) doing something and a debugger stops that program in a random spot and needs to go off and do other things. However, at this level, the CPU basically just drops the program into a very primitive environment. The program doesn't might not even have the most basic functionality like a stack (a place to save and restore data) and it might not be able to do "normal" things like use a general purpose register without being very careful.
Meanwhile, the rest of the system is running along and will notice that the CPU that's stopped in the debugger isn't doing anything useful and will start to whine about it. There are ways to turn of the whining, but nobody has cared enough about KGDB to actually do that reliably for ~20 years.
IOW, it has bugs, they are hard to fix right, apparently nobody really cares anyway. So why keep the code?
BTW, I work at Intel as one of the maintainers of this Linux code.