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:

This page is maintained by Doug Evans ( And is a work-in-progress. :-)


PR 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

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).

None: BackgroundExecution (last edited 2014-08-01 18:41:19 by DougEvans)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.