Like in
for((;;)) {
gdb -batch -n -ex 'set pagination off' -ex 'thread apply all bt' ffplay_g `pidof ffplay_g` >> /tmp/qq;
}
, but faster, without reloading GDB and symbols every time?
Backtraces need to be taken by timer, not by triggering some breakpoints.
As recommended by the comment
If you want to stick with gdb, then why not script a gdb session? Your controller process can sleep for 50 ms, then wake up, send a ^C, t a a bt, c, and then go back to sleep. – Jeremy W. Shermanhttp://vi-server.org/vi/bin/gdbdriver.pl