10-26-2011
23,310,
4,623
Join Date: Aug 2005
Last Activity: 7 July 2020, 11:47 AM EDT
Location: Saskatchewan
Posts: 23,310
Thanks Given: 1,331
Thanked 4,623 Times in 4,217 Posts
The kernel is what starts and stops processes on breakpoints, watches memory, etc. on command -- gdb just tells the kernel what to do. Without a kernel to facilitate them, these features are not available.
gdb or any other process gets halted by the kernel when making a system call anyway. It doesn't "step in" because there's nothing to step in to; it's not a function call, it calls INT 0x20 (I think) and suspends itself until the system call is done. Once the system call is done, it starts again.
The traditional way to debug the kernel is lots of debugging spew, preferably directly to an external device so it doesn't get lost on crash.
To get that level of debugging on the kernel itself, you would need some sort of virtual machine, I think.