Background execution improvements
This page describes some thoughts on improving GDB's support for background execution.
For reference sake, background execution is documented in the user manual here: https://sourceware.org/gdb/current/onlinedocs/gdb/Background-Execution.html
This page is maintained by Doug Evans (dje@google.com). And is a work-in-progress.
Issues
PR 17223
https://sourceware.org/bugzilla/show_bug.cgi?id=17223
Doing background execution in scripts is not well supported. Inferior events are not processed while the script is executing and thus, for example, gdb is never informed about new threads.
PR 14236
https://sourceware.org/bugzilla/show_bug.cgi?id=14236
This pr documents a problem with the "interrupt" command. It doesn't wait for the thread to stop (or all threads if -a is passed), like an ampersand ("&") is always implicitly supplied.
Waiting for a thread to stop
There's no way for a script to wait for a particular thread to stop (or all threads to stop), which will be important if one wants to then do something with the thread after it's stopped. One thought is to add a new "wait" command.
It might also be useful to have a $_is_running convenience function.
Though "running" and "executing" are at times ambiguous in the gdb sources - it would be good to enforce some consistency of usage.
i.e., one needs to distinguish whether a thread is alive (or has exited) and whether a thread is running (or stopped - what "info thread" shows).