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 (email@example.com). And is a work-in-progress.
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.
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).