public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v5 0/5] Handling already-exited threads in 'stop_all_threads'
@ 2020-04-06 15:45 Tankut Baris Aktemur
       [not found] ` <cover.1586187408.git.tankut.baris.aktemur@intel.com>
  0 siblings, 1 reply; 16+ messages in thread
From: Tankut Baris Aktemur @ 2020-04-06 15:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: palves, tdevries

Hi,

This is the v5 of a series that aims to fix GDB going into an infinite
loop when it attempts to stop a thread in 'stop_all_threads', if the
thread has already died.  The problem is fixed by handling
waitstatuses that denote exiting.

For the most recent comment, please see

  https://sourceware.org/pipermail/gdb-patches/2020-April/167286.html

The v4 is available at

  https://sourceware.org/legacy-ml/gdb-patches/2020-02/msg00153.html

This revision, v5, makes the following changes:

* The exit event of the thread we've attempted to stop is saved as a
  pending event.  The event is processed only when the user resumes the
  process.

* Two additional predecessor patches are added to tolerate errors
  while reading registers of a dead process so that the 'proceed' flow
  of GDB can make progress.

* Another predecessor patch is added to not delete a thread if it has
  a pending event.  This was needed for when the target is a remote
  target, because remote_target::update_thread_list deletes threads
  that don't exist in the target anymore.

* The case for when the ptid of the exit event is not a full ptid but
  only a pid is handled (e.g.  "8262.0.0" instead of "8262.8262.0").

* A new test scenario is added to cover the case mentioned above (by
  using gdbserver as the target).

The series assumes that a fix to the infinite query problem explained
in the link below has been applied beforehand:

  https://sourceware.org/pipermail/gdb-patches/2020-March/166982.html

Thanks.
Baris

Tankut Baris Aktemur (5):
  gdb: protect some 'regcache_read_pc' calls
  gdb/infrun: move a 'regcache_read_pc' call down to first use
  gdb/remote: do not delete a thread if it has a pending event
  gdb/infrun: extract out a code piece into 'mark_non_executing_threads'
    function
  gdb/infrun: handle already-exited threads when attempting to stop

 gdb/infrun.c                           | 146 ++++++++++++++++--------
 gdb/regcache.c                         |  18 +++
 gdb/remote.c                           |   3 +
 gdb/testsuite/gdb.multi/multi-exit.c   |  22 ++++
 gdb/testsuite/gdb.multi/multi-exit.exp | 147 +++++++++++++++++++++++++
 gdb/testsuite/gdb.multi/multi-kill.c   |  34 ++++++
 gdb/testsuite/gdb.multi/multi-kill.exp | 104 +++++++++++++++++
 gdbsupport/common-regcache.h           |   5 +
 8 files changed, 434 insertions(+), 45 deletions(-)
 create mode 100644 gdb/testsuite/gdb.multi/multi-exit.c
 create mode 100644 gdb/testsuite/gdb.multi/multi-exit.exp
 create mode 100644 gdb/testsuite/gdb.multi/multi-kill.c
 create mode 100644 gdb/testsuite/gdb.multi/multi-kill.exp

-- 
2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-04-22 14:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 15:45 [PATCH v5 0/5] Handling already-exited threads in 'stop_all_threads' Tankut Baris Aktemur
     [not found] ` <cover.1586187408.git.tankut.baris.aktemur@intel.com>
2020-04-06 15:45   ` [PATCH v5 1/5] gdb: protect some 'regcache_read_pc' calls Tankut Baris Aktemur
2020-04-16 16:11     ` Pedro Alves
2020-04-20 20:13       ` Aktemur, Tankut Baris
2020-04-06 15:45   ` [PATCH v5 2/5] gdb/infrun: move a 'regcache_read_pc' call down to first use Tankut Baris Aktemur
2020-04-16 16:12     ` Pedro Alves
2020-04-06 15:45   ` [PATCH v5 3/5] gdb/remote: do not delete a thread if it has a pending event Tankut Baris Aktemur
2020-04-16 16:24     ` Pedro Alves
2020-04-20 20:35       ` Aktemur, Tankut Baris
2020-04-21 18:54         ` Pedro Alves
2020-04-22 14:57           ` Aktemur, Tankut Baris
2020-04-06 15:45   ` [PATCH v5 4/5] gdb/infrun: extract out a code piece into 'mark_non_executing_threads' function Tankut Baris Aktemur
2020-04-16 16:24     ` Pedro Alves
2020-04-06 15:45   ` [PATCH v5 5/5] gdb/infrun: handle already-exited threads when attempting to stop Tankut Baris Aktemur
2020-04-16 17:06     ` Pedro Alves
2020-04-20 20:43       ` Aktemur, Tankut Baris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).