aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.h
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2021-01-11 20:01:58 +0000
committerPedro Alves <pedro@palves.net>2021-02-03 01:15:19 +0000
commit408f66864a1a823591b26420410c982174c239a2 (patch)
treeebca2b15942730a15f70b27dcb4b54b6c69eac24 /gdb/infrun.h
parentac7d717c1eb2421d64135ef0e6cf19de74b8d5d3 (diff)
downloadfsf-binutils-gdb-408f66864a1a823591b26420410c982174c239a2.zip
fsf-binutils-gdb-408f66864a1a823591b26420410c982174c239a2.tar.gz
fsf-binutils-gdb-408f66864a1a823591b26420410c982174c239a2.tar.bz2
detach in all-stop with threads running
A following patch will add a testcase that has a number of threads constantly stepping over a breakpoint, and then has GDB detach the process, while threads are running. If we have more than one inferior running, and we detach from just one of the inferiors, we expect that the remaining inferior continues running. However, in all-stop, if GDB needs to pause the target for the detach, nothing is re-resuming the other inferiors after the detach. "info threads" shows the threads as running, but they really aren't. This fixes it. gdb/ChangeLog: * infcmd.c (detach_command): Hold strong reference to target, and if all-stop on entry, restart threads on exit. * infrun.c (switch_back_to_stepped_thread): Factor out bits to ... (restart_stepped_thread): ... this new function. Also handle trap_expected. (restart_after_all_stop_detach): New function. * infrun.h (restart_after_all_stop_detach): Declare.
Diffstat (limited to 'gdb/infrun.h')
-rw-r--r--gdb/infrun.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/infrun.h b/gdb/infrun.h
index 7160b60..e643c84 100644
--- a/gdb/infrun.h
+++ b/gdb/infrun.h
@@ -269,4 +269,8 @@ extern void all_uis_check_sync_execution_done (void);
started or re-started). */
extern void all_uis_on_sync_execution_starting (void);
+/* In all-stop, restart the target if it had to be stopped to
+ detach. */
+extern void restart_after_all_stop_detach (process_stratum_target *proc_target);
+
#endif /* INFRUN_H */