public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/6] Eliminate infrun_thread_thread_exit observer
Date: Sat,  3 Dec 2022 21:13:32 +0000	[thread overview]
Message-ID: <20221203211338.2264994-1-pedro@palves.net> (raw)

This series started out as me realizing that I had one change in the
pending step-over-thread-exit series that was in conflict with
infrun_thread_thread_exit.  infrun_thread_thread_exit wants to clear
the last target waitstatus when that status is for the thread that
exited, while I'll need to preserve the thread exit waitstatus for
normal stop.  In the step-over-thread-exit series, I was calling
set_last_target_status again when handling a
TARGET_WAITKING_THREAD_EXIT, and that was undoing the clear that
infrun_thread_thread_exit does.

So I looked at eliminating infrun_thread_thread_exit, see if we could
make whatever is relying on it no longer rely on it.

The end result is this thread.  It ends up fixing some bugs and
improving GDB behavior such that I think it stands on its own, even
without the last patch, the one that finally eliminates
infrun_thread_thread_exit.  I kept the thread title about
infrun_thread_thread_exit because that's my end goal, but I could as
well remove the last patch and call this thread "improve 'info
program' and 'follow-fork'".

Tested on x86-64 GNU/Linux, native and extended-gdbserver.

Pedro Alves (6):
  Tweak "Using the running image of ..." output
  Convert previous_inferior_ptid to strong reference to thread_info
  Improve "info program"
  Make follow_fork not rely on get_last_target_status
  all-stop "follow-fork parent" and selecting another thread
  Remove infrun_thread_thread_exit observer

 gdb/inf-ptrace.c                              |   2 +-
 gdb/infcmd.c                                  |  84 +++++--
 gdb/infrun.c                                  | 214 +++++++++++++-----
 gdb/infrun.h                                  |   7 +
 gdb/nto-procfs.c                              |   2 +-
 gdb/procfs.c                                  |   2 +-
 gdb/target.c                                  |   5 +
 gdb/testsuite/gdb.base/catch-follow-exec.exp  |  17 +-
 gdb/testsuite/gdb.base/foll-fork.exp          |  36 ++-
 gdb/testsuite/gdb.base/info-program.c         |  66 ++++++
 gdb/testsuite/gdb.base/info-program.exp       | 131 +++++++++--
 .../gdb.threads/foll-fork-other-thread.c      |  84 +++++++
 .../gdb.threads/foll-fork-other-thread.exp    | 172 ++++++++++++++
 gdb/windows-nat.c                             |   2 +-
 14 files changed, 712 insertions(+), 112 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/info-program.c
 create mode 100644 gdb/testsuite/gdb.threads/foll-fork-other-thread.c
 create mode 100644 gdb/testsuite/gdb.threads/foll-fork-other-thread.exp


base-commit: fb699bafb5f23c2fd43d7f20495171b16903b20f
-- 
2.36.0


             reply	other threads:[~2022-12-03 21:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03 21:13 Pedro Alves [this message]
2022-12-03 21:13 ` [PATCH 1/6] Tweak "Using the running image of ..." output Pedro Alves
2022-12-08 21:30   ` Simon Marchi
2022-12-03 21:13 ` [PATCH 2/6] Convert previous_inferior_ptid to strong reference to thread_info Pedro Alves
2022-12-03 21:13 ` [PATCH 3/6] Improve "info program" Pedro Alves
2022-12-03 21:13 ` [PATCH 4/6] Make follow_fork not rely on get_last_target_status Pedro Alves
2022-12-03 21:13 ` [PATCH 5/6] all-stop "follow-fork parent" and selecting another thread Pedro Alves
2022-12-03 21:13 ` [PATCH 6/6] Remove infrun_thread_thread_exit observer Pedro Alves
2023-02-27 19:12 ` [PATCH 0/6] Eliminate " Pedro Alves

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=20221203211338.2264994-1-pedro@palves.net \
    --to=pedro@palves.net \
    --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).