Is it possible to have gdb attached to the PID of a running process and every time the program hits a particular breakpoint have gdb output the stackframe to an external file?
I've had a look at this and this but there is no mention on whether it is possible to attach gdb to an already running process (instead of having gdb launch it).
I can otherwise attach gdb to the PID just fine, but I'd like to automate it to run bt
, store the output in an external file and then run continue
. At the moment I'm doing this manually and it's a pain when I have to do it every time a breakpoint is hit.