[PATCH 0/2] All threads not stopped when a process exits

Tankut Baris Aktemur tankut.baris.aktemur@intel.com
Thu Feb 6 08:30:00 GMT 2020


Hi All,

This is a 2-part series that aims to fix the problem of all threads
not being stopped when a process exits.  The problem is, if we are in
all-stop mode with multiple inferiors, and an exit event is received
from an inferior, target_mourn_inferior() unpushes the process target
and leaves exec_ops as the top target of the current inferior.  This
new top target is not non-stop.  Hence, stop_all_threads() is skipped.
If there are other inferiors, they remain running instead of being
stopped.

Thanks,
Baris


Tankut Baris Aktemur (2):
  gdb: define convenience function 'exists_non_stop_target'
  gdb/infrun: stop all threads if there exists a non-stop target

 gdb/infrun.c                                 | 19 ++++--
 gdb/target.c                                 | 20 ++++++
 gdb/target.h                                 |  3 +
 gdb/testsuite/gdb.multi/stop-all-on-exit.c   | 27 +++++++++
 gdb/testsuite/gdb.multi/stop-all-on-exit.exp | 64 ++++++++++++++++++++
 5 files changed, 129 insertions(+), 4 deletions(-)
 create mode 100644 gdb/testsuite/gdb.multi/stop-all-on-exit.c
 create mode 100644 gdb/testsuite/gdb.multi/stop-all-on-exit.exp

-- 
2.17.1



More information about the Gdb-patches mailing list