I am debugging a rather complex project, I have its source code, currently I need to know the stack trace when daemon exits in certain case, but it is very time consuming to go through the whole code, I want to use gdb to help on this, but commands like "catch exit" won't work, it told me that "Catch of exit not yet implemented", so can anyone tell me how to use gdb to catch the exit event of a daemon? Thank you.
(gdb) catch syscall 60
Catchpoint 3 (syscall 'exit' [60])
(gdb) catch syscall 231
Catchpoint 4 (syscall 'exit_group' [231])
I think just setting breakpoints for exit
, _exit
, and abort
should get you pretty far.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With