public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v8 0/6] Handle already-exited threads in 'stop_all_threads'
Date: Wed, 13 May 2020 21:53:32 +0100	[thread overview]
Message-ID: <20200513205338.14233-1-palves@redhat.com> (raw)

Here's v8 of Tankut's series that fixes an infinite loop when GDB
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.  It also includes a broader change to handle the case
of a whole process exiting while GDB is stopping all threads.

I'm resending the whole series for Tankut under a new cover letter
because I find that sending just chunks of the series makes it hard to
piece things together and make sense of where we are.

Compared to v7, the main change is in the last patch of the series.
I've thought through how to handle the case of a process exiting while
we're stopping all threads in stop_all_threads.  This version switches
back to avoiding deleting the last thread of an inferior in remote.c's
target_update_thread_list implementation instead of the previous
proposal of not deleting threads with a status pending and re-adding
threads in stop_all_threads.  See the updated tail end of the commit
log of the last patch, which describes the new change in more detail.
It then tweaks a few things in common code related to that change, and
also makes the new testcases spawn more than 2 inferiors.

Tankut Baris Aktemur (6):
  gdb: protect some 'regcache_read_pc' calls
  gdb/infrun: move a 'regcache_read_pc' call down to first use
  gdb/infrun: extract out a code piece into 'mark_non_executing_threads'
    function
  gdb: introduce 'all_non_exited_process_targets' and
    'switch_to_target_no_thread'
  gdb/infrun: enable/disable thread events of all targets in
    stop_all_threads
  gdb/infrun: handle already-exited threads when attempting to stop

 gdb/infrun.c                           | 188 +++++++++++++++++++++------------
 gdb/process-stratum-target.c           |  24 +++++
 gdb/process-stratum-target.h           |  10 ++
 gdb/regcache.c                         |  18 ++++
 gdb/remote.c                           |  20 ++++
 gdb/testsuite/gdb.base/annota1.exp     |   2 +-
 gdb/testsuite/gdb.cp/annota2.exp       |   2 +-
 gdb/testsuite/gdb.multi/multi-exit.c   |  22 ++++
 gdb/testsuite/gdb.multi/multi-exit.exp | 138 ++++++++++++++++++++++++
 gdb/testsuite/gdb.multi/multi-kill.c   |  42 ++++++++
 gdb/testsuite/gdb.multi/multi-kill.exp | 127 ++++++++++++++++++++++
 gdb/thread.c                           |   2 +-
 gdbsupport/common-regcache.h           |   5 +
 13 files changed, 531 insertions(+), 69 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


base-commit: f7e23710fcb7133a3bbe7795ad0ddd2defca358a
-- 
2.14.5


             reply	other threads:[~2020-05-13 20:53 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 20:53 Pedro Alves [this message]
2020-05-13 20:53 ` [PATCH v8 1/6] gdb: protect some 'regcache_read_pc' calls Pedro Alves
2020-05-13 20:53 ` [PATCH v8 2/6] gdb/infrun: move a 'regcache_read_pc' call down to first use Pedro Alves
2020-05-13 20:53 ` [PATCH v8 3/6] gdb/infrun: extract out a code piece into 'mark_non_executing_threads' function Pedro Alves
2020-05-13 20:53 ` [PATCH v8 4/6] gdb: introduce 'all_non_exited_process_targets' and 'switch_to_target_no_thread' Pedro Alves
2020-05-14  8:44   ` Aktemur, Tankut Baris
2020-05-14 11:12     ` Pedro Alves
2020-05-14 11:23       ` Aktemur, Tankut Baris
2020-05-13 20:53 ` [PATCH v8 5/6] gdb/infrun: enable/disable thread events of all targets in stop_all_threads Pedro Alves
2020-05-14  8:44   ` Aktemur, Tankut Baris
2020-05-14 11:16     ` Pedro Alves
2020-05-14 11:30       ` Aktemur, Tankut Baris
2020-05-13 20:53 ` [PATCH v8 6/6] gdb/infrun: handle already-exited threads when attempting to stop Pedro Alves
2020-05-14  8:47   ` Aktemur, Tankut Baris
2020-05-14 11:16     ` Pedro Alves
2020-05-14 11:40       ` Aktemur, Tankut Baris
2020-05-14 18:00   ` Tom de Vries
2020-05-14 18:54     ` Aktemur, Tankut Baris
2020-05-14 18:58       ` Pedro Alves
2020-05-15  7:53         ` Aktemur, Tankut Baris
2020-05-15 10:14           ` Pedro Alves
2020-05-15 10:17         ` Tom de Vries
2020-05-15 10:35           ` Pedro Alves
2020-05-15 11:53         ` Tom de Vries
2020-05-15 12:02           ` Pedro Alves
2020-05-15 14:16             ` Tom de Vries
2020-05-15 15:46               ` Pedro Alves
2020-05-15 17:17                 ` Tom de Vries
2020-05-18  6:18                   ` [PATCH][gdb/testsuite] Warn about leaked global array Tom de Vries
2020-05-18 10:41                     ` Pedro Alves
2020-05-19 16:34                       ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200513205338.14233-1-palves@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).