From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26238 invoked by alias); 17 Apr 2015 10:47:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26070 invoked by uid 89); 17 Apr 2015 10:47:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 17 Apr 2015 10:47:53 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3HAlmJT018198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 17 Apr 2015 06:47:52 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3HAjMtl009369 for ; Fri, 17 Apr 2015 06:45:22 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v3 00/23] All-stop on top of non-stop Date: Fri, 17 Apr 2015 10:47:00 -0000 Message-Id: <1429267521-21047-1-git-send-email-palves@redhat.com> X-SW-Source: 2015-04/txt/msg00662.txt.bz2 This is v3 of the series first posted at: https://sourceware.org/ml/gdb-patches/2015-04/msg00073.html v2 here: https://sourceware.org/ml/gdb-patches/2015-04/msg00198.html Compared to v2, this version: - Fixes problems on software single-step targets, first exposed by Yao's ARM testing. - Makes the per-inferior displaced stepping queue work correctly again. v1 and v2 has borked that. - General cleanups. A few patches in v2 were pushed to master meanwhile. This one in v2 was dropped in v3: https://sourceware.org/ml/gdb-patches/2015-04/msg00207.html PPC64: symbol-file + exec-file results in broken displaced stepping because we now don't trip on that issue anymore, since this went in: https://sourceware.org/ml/gdb-patches/2015-04/msg00341.html [PATCH][AT_ENTRY version] PR13858 - Can't do displaced stepping with no symbols The bug is still present, but is now latent, so I'll probably resend that one out separately at some point. I tried to mention the differences to v2 in each patch that had changes, if any (scroll past ChangeLog). Documentation changes have not changed, and have already been approved. Note most of these patches can go in without the final bits that actually do all-stop-on-top-of-non-stop, as they fix problems that exist e.g., with "set non-stop on" or "set displaced-stepping on" too. I've (force) pushed this to users/palves/all-stop-non-stop for review and testing convenience. Tested on: x86-64 GNU/Linux x86-64 GNU/Linux on top of software single-step branch PPC64 GNU/Linux S/390 GNU/Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Series-intro proper follows: This series implements user-visible all-stop mode running with the target_ops backend always in non-stop mode. This is a stepping stone towards finer-grained control of threads, being able to do interesting things like inferior and thread groups/sets (itsets), associating groups with breakpoints (which threads cause a stop, which threads are implicitly paused when a breakpoint triggers), etc. From the user's perspective, all-stop mode is really just a special case of being able to stop and resume specific sets of threads, so it makes sense to do this step first. After this series, even in all-stop mode ("set non-stop off", the default) the target is no longer in charge of stopping all threads before reporting an event to the core -- the core takes care of it when it sees fit. For example, when "next"- or "step"-ing, we can avoid stopping and resuming all threads at each internal single-step, and instead only stop all threads when we're about to present the stop to the user. In order to get there, the series teaches GDB to do non-stop mode even without displaced stepping (stop all threads, step over breakpoint, restart threads), as displaced stepping isn't implemented everywhere, and doesn't work in some scenarios (as in, we can't use it, not that it's buggy). And then it fixes all testsuite regressions (on native x86-64, ppc64 and s390 GNU/Linux) this new mode causes, compared to all-stop ("set non-stop off") with the target backend in all-stop mode too (i.e., the current default). Making "target remote" work in always non-stop mode is deferred for later (this will be even more useful for remote as the all-stop mode RSP variant can't really do asynchronous debugging). Tested on x86_64 Fedora 20, native, with and without "set displaced off", and with and without "maint set target-non-stop on"; and also against gdbserver. Tested on x86-64 GNU/Linux native on top of x86 software single-step branch. Tested on PPC64 Fedora 18. Tested on S/390 RHEL 7.1. Pedro Alves (17): Fix and test "checkpoint" in non-stop mode Change adjust_pc_after_break's prototype remote.c/all-stop: Implement TARGET_WAITKIND_NO_RESUMED and TARGET_WNOHANG Make thread_still_needs_step_over consider stepping_over_watchpoint too Embed the pending step-over chain in thread_info objects Use keep_going in proceed and start_step_over too Misc switch_back_to_stepped_thread cleanups Factor out code to re-resume stepped thread Teach non-stop to do in-line step-overs (stop all, step, restart) Implement all-stop on top of a target running non-stop mode Fix signal-while-stepping-over-bp-other-thread.exp on targets always in non-stop Fix interrupt-noterm.exp on targets always in non-stop Fix step-over-{trips-on-watchpoint|lands-on-breakpoint}.exp race Disable displaced stepping if trying it fails PPC64: Fix gdb.arch/ppc64-atomic-inst.exp with displaced stepping S/390: displaced stepping and PC-relative RIL-b/RIL-c instructions native Linux: enable always non-stop by default gdb/NEWS | 6 + gdb/breakpoint.c | 11 +- gdb/darwin-nat.c | 6 +- gdb/doc/gdb.texinfo | 24 + gdb/gdbarch.h | 6 +- gdb/gdbarch.sh | 4 + gdb/gdbthread.h | 60 +- gdb/gnu-nat.c | 7 - gdb/inf-ptrace.c | 6 +- gdb/infcmd.c | 6 +- gdb/infrun.c | 2290 +++++++++++++++----- gdb/infrun.h | 7 + gdb/linux-nat.c | 33 +- gdb/monitor.c | 4 +- gdb/nto-procfs.c | 14 +- gdb/procfs.c | 4 +- gdb/remote-m32r-sdi.c | 6 +- gdb/remote-sim.c | 20 +- gdb/remote.c | 57 +- gdb/rs6000-tdep.c | 68 +- gdb/s390-linux-tdep.c | 115 +- gdb/target-delegates.c | 59 + gdb/target.c | 83 + gdb/target.h | 24 +- gdb/target/waitstatus.h | 5 +- gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp | 50 +- gdb/testsuite/gdb.base/checkpoint-ns.exp | 27 + gdb/testsuite/gdb.base/checkpoint.exp | 31 +- gdb/testsuite/gdb.base/valgrind-disp-step.c | 32 + gdb/testsuite/gdb.base/valgrind-disp-step.exp | 131 ++ .../signal-while-stepping-over-bp-other-thread.exp | 2 +- .../gdb.threads/step-over-lands-on-breakpoint.c | 17 +- .../gdb.threads/step-over-lands-on-breakpoint.exp | 6 +- .../gdb.threads/step-over-trips-on-watchpoint.c | 17 +- .../gdb.threads/step-over-trips-on-watchpoint.exp | 9 +- gdb/thread.c | 197 +- gdb/windows-nat.c | 6 +- 37 files changed, 2741 insertions(+), 709 deletions(-) create mode 100644 gdb/testsuite/gdb.base/checkpoint-ns.exp create mode 100644 gdb/testsuite/gdb.base/valgrind-disp-step.c create mode 100644 gdb/testsuite/gdb.base/valgrind-disp-step.exp -- 1.9.3