public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/12] Fix detach + displaced-step regression + N bugs more
@ 2021-01-13  1:15 Pedro Alves
  2021-01-13  1:15 ` [PATCH 01/12] Fix attaching in non-stop mode Pedro Alves
                   ` (11 more replies)
  0 siblings, 12 replies; 36+ messages in thread
From: Pedro Alves @ 2021-01-13  1:15 UTC (permalink / raw)
  To: gdb-patches

I noticed that the "detach" command while the inferior is running
recently regressed -- the inferior crashes with SIGTRAP if it happens
to be detached just while it is doing a displaced step.  The fix
looked very simple, it's just a reversed condition, so I fixed it, and
wrote a testcase.  That's then the trouble started -- the testcase
exposed a TON of other issues, of the "stare at infrun and gdbserver
logs for days" kind...  I would set the testcase running in a loop,
and then once in a while, puuft, a new racy bug would trigger.

This fixes all the bugs I ran into.  I won't be surprised if the
testcase still manages to expose some more racy problems.  But I did
leave it running for hours at time on my machine more than once, like
this:

$ (set -e; while true; do \
    make check TESTS="gdb.threads/detach-step-over.exp" RUNTESTFLAGS="--target_board=native-extended-gdbserver"; \
    make check TESTS="gdb.threads/detach-step-over.exp"; \
    done)

and nothing showed up.

For your convenience, I've pushed this to the
users/palves/detach-step-over branch.

Pedro Alves (12):
  Fix attaching in non-stop mode
  Fix "target extended-remote" + "maint set target-non-stop" + "attach"
  Testcase for attaching in non-stop mode
  Fix a couple vStopped pending ack bugs
  gdbserver: spurious SIGTRAP w/ detach while step-over in progress
  Factor out after-stop event handling code from stop_all_threads
  prepare_for_detach: don't release scoped_restore at the end
  prepare_for_detach and ongoing displaced stepping
  detach and breakpoint removal
  detach with in-line step over in progress
  detach in all-stop with threads running
  Testcase for detaching while stepping over breakpoint

 gdb/infcmd.c                                  |  13 +
 gdb/infrun.c                                  | 640 ++++++++++--------
 gdb/infrun.h                                  |   4 +
 gdb/linux-nat.c                               |   5 +
 gdb/remote.c                                  |  39 +-
 gdb/target.c                                  |   9 -
 gdb/testsuite/gdb.threads/attach-non-stop.c   |  58 ++
 gdb/testsuite/gdb.threads/attach-non-stop.exp | 149 ++++
 gdb/testsuite/gdb.threads/detach-step-over.c  | 112 +++
 .../gdb.threads/detach-step-over.exp          | 290 ++++++++
 gdbserver/linux-low.cc                        |  29 +-
 gdbserver/server.cc                           |   9 +
 12 files changed, 1072 insertions(+), 285 deletions(-)
 create mode 100644 gdb/testsuite/gdb.threads/attach-non-stop.c
 create mode 100644 gdb/testsuite/gdb.threads/attach-non-stop.exp
 create mode 100644 gdb/testsuite/gdb.threads/detach-step-over.c
 create mode 100644 gdb/testsuite/gdb.threads/detach-step-over.exp


base-commit: bfc7d04afbeb56a3dc3caa71322a71fbb084d5dd
-- 
2.26.2


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

end of thread, other threads:[~2021-07-12 19:36 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  1:15 [PATCH 00/12] Fix detach + displaced-step regression + N bugs more Pedro Alves
2021-01-13  1:15 ` [PATCH 01/12] Fix attaching in non-stop mode Pedro Alves
2021-01-13  3:11   ` Simon Marchi
2021-02-03  1:21     ` Pedro Alves
2021-01-13  1:15 ` [PATCH 02/12] Fix "target extended-remote" + "maint set target-non-stop" + "attach" Pedro Alves
2021-01-13  5:01   ` Simon Marchi
2021-01-13  1:15 ` [PATCH 03/12] Testcase for attaching in non-stop mode Pedro Alves
2021-01-13  5:09   ` Simon Marchi
2021-02-03  1:23     ` Pedro Alves
2021-01-13  1:15 ` [PATCH 04/12] Fix a couple vStopped pending ack bugs Pedro Alves
2021-01-13  5:29   ` Simon Marchi
2021-02-03  1:25     ` Pedro Alves
2021-01-13  1:15 ` [PATCH 05/12] gdbserver: spurious SIGTRAP w/ detach while step-over in progress Pedro Alves
2021-01-13  6:00   ` Simon Marchi
2021-02-03  1:26     ` Pedro Alves
2021-01-13  1:15 ` [PATCH 06/12] Factor out after-stop event handling code from stop_all_threads Pedro Alves
2021-01-13  6:06   ` Simon Marchi
2021-02-03  1:26     ` Pedro Alves
2021-01-13  1:15 ` [PATCH 07/12] prepare_for_detach: don't release scoped_restore at the end Pedro Alves
2021-01-13  6:08   ` Simon Marchi
2021-02-03  1:27     ` Pedro Alves
2021-01-13  1:15 ` [PATCH 08/12] prepare_for_detach and ongoing displaced stepping Pedro Alves
2021-01-13  6:23   ` Simon Marchi
2021-01-13  1:15 ` [PATCH 09/12] detach and breakpoint removal Pedro Alves
2021-01-13  6:32   ` Simon Marchi
2021-02-03  1:28     ` Pedro Alves
2021-01-13  1:15 ` [PATCH 10/12] detach with in-line step over in progress Pedro Alves
2021-01-13  6:39   ` Simon Marchi
2021-01-13  1:15 ` [PATCH 11/12] detach in all-stop with threads running Pedro Alves
2021-01-13  6:55   ` Simon Marchi
2021-02-03  1:31     ` Pedro Alves
2021-07-12 15:36   ` Jonah Graham
2021-07-12 19:36     ` Pedro Alves
2021-01-13  1:15 ` [PATCH 12/12] Testcase for detaching while stepping over breakpoint Pedro Alves
2021-01-13  7:05   ` Simon Marchi
2021-02-03  1:33     ` Pedro Alves

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).