You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when gdb is attached to a running process and receives a SIGINT, it pauses the debug target. this is nice because when you're debugging something where the kernel gets into a weird state or hangs or whatever, you can just wait for it to get to that state, whack C-c, and get it to pause wherever it is. this way, you don't have to figure out where you need breakpoints to be ahead of time or anything.
the main way to use GDB to debug mycelium is using the inoculate commands that start the kernel in QEMU and then attach a remote GDB to them. unfortunately, this means that you're not running GDB directly, you're running a Rust program that spawns a GDB process. and when the inoculate process gets a SIGINT, it does the default rust program behavior of killing its children and terminating. so, GDB doesn't handle the SIGINT by suspending the kernel. instead, it freaks out because the debug target has just disappeared, and then it immediately gets killed itself. so you can't just whack C-c and get it to pause.
instead, if you want to make GDB pause a wedged kernel when you whack C-c, you have to figure out the GDB command that the inoculate wrapper would use (mainly "where is the kernel binary to read symbols from") and invoke that command yourself. this is fine but it's not as nice as just using the inoculate command that i wrote to specifically do this.
we could make this nicer and have the inoculate command actually catch SIGINTs and just send them to the GDB process, instead of interpreting it as YES IT IS DEFINITELY TIME FOR ME TO EXIT IMMEDIATELY. this is probably a little annoying to actually do, but not all that hard...and it would make the dev experience way nicer.
The text was updated successfully, but these errors were encountered:
when gdb is attached to a running process and receives a SIGINT, it pauses the debug target. this is nice because when you're debugging something where the kernel gets into a weird state or hangs or whatever, you can just wait for it to get to that state, whack
C-c
, and get it to pause wherever it is. this way, you don't have to figure out where you need breakpoints to be ahead of time or anything.the main way to use GDB to debug mycelium is using the inoculate commands that start the kernel in QEMU and then attach a remote GDB to them. unfortunately, this means that you're not running GDB directly, you're running a Rust program that spawns a GDB process. and when the inoculate process gets a SIGINT, it does the default rust program behavior of killing its children and terminating. so, GDB doesn't handle the SIGINT by suspending the kernel. instead, it freaks out because the debug target has just disappeared, and then it immediately gets killed itself. so you can't just whack
C-c
and get it to pause.instead, if you want to make GDB pause a wedged kernel when you whack
C-c
, you have to figure out the GDB command that the inoculate wrapper would use (mainly "where is the kernel binary to read symbols from") and invoke that command yourself. this is fine but it's not as nice as just using the inoculate command that i wrote to specifically do this.we could make this nicer and have the inoculate command actually catch SIGINTs and just send them to the GDB process, instead of interpreting it as YES IT IS DEFINITELY TIME FOR ME TO EXIT IMMEDIATELY. this is probably a little annoying to actually do, but not all that hard...and it would make the dev experience way nicer.
The text was updated successfully, but these errors were encountered: