From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70359 invoked by alias); 14 Oct 2015 15:28:19 -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 70260 invoked by uid 89); 14 Oct 2015 15:28:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham 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; Wed, 14 Oct 2015 15:28:10 +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 (Postfix) with ESMTPS id 291128E70B for ; Wed, 14 Oct 2015 15:28:08 +0000 (UTC) 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 t9EFS6DZ016846 for ; Wed, 14 Oct 2015 11:28:07 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 00/18] Remote all-stop on top of non-stop Date: Wed, 14 Oct 2015 15:28:00 -0000 Message-Id: <1444836486-25679-1-git-send-email-palves@redhat.com> X-SW-Source: 2015-10/txt/msg00213.txt.bz2 This series implements remote support for all-stop on top of non-stop. The first bits do the base work, enough to start running the testsuite with "maint set target-non-stop on". And then one by one, the patches tackle issues exposed by the testsuite until I found no regressions on x86-64 Fedora 20 (remote and extended-remote). The last patch in the series enables the feature by default. What this means is that for non-stop-aware remote stubs that support all the needed extensions, GDB will always connect in non-stop mode. Note that from the users' perspective, nothing should change -- gdb still stops all threads whenever a breakpoint hits, etc. The difference is that with the remote side in non-stop mode, gdb is always free to sent commands/packets, even while the target is running, due to the asynchronous nature of the non-stop variant of the RSP. E.g., Before: (gdb) c& Continuing. (gdb) Reading /lib64/libpthread.so.0 from remote target... Reading /lib64/libc.so.6 from remote target... b threads.c:68 Cannot execute this command while the target is running. Use the "interrupt" command to stop the target and then try again. (gdb) After: (gdb) c& Continuing. (gdb) Reading /lib64/libpthread.so.0 from remote target... Reading /lib64/libc.so.6 from remote target... info threads [New Thread 24891] [New Thread 24892] Id Target Id Frame 3 Thread 24892 (running) 2 Thread 24891 (running) * 1 Thread 24881 (running) (gdb) b threads.c:68 Breakpoint 1 at 0x400811: file threads.c, line 68. (gdb) [Switching to Thread 24891] Breakpoint 1, thread_function0 (arg=0x0) at threads.c:68 68 (*myp) ++; info threads Id Target Id Frame 3 Thread 24892 0x0000003615ebc6ed in nanosleep () at ../sysdeps/unix/syscall-template.S:81 * 2 Thread 24891 thread_function0 (arg=0x0) at threads.c:68 1 Thread 24881 0x0000003616a09237 in pthread_join (threadid=140737353881344, thread_return=0x7fffffffd718) at pthread_join.c:92 (gdb) In addition, this paves to way for itsets support with remote targets too. As with the equivalent work done for the native target, it's easy to revert back to the old behavior by entering "maint set target-non-stop off" or reverting the last patch. Pedro Alves (18): Fix mi-nonstop.exp with extended-remote Remote all-stop-on-top-of-non-stop attach + target always in non-stop mode: stop all threads gdbserver crash running gdb.threads/non-ldr-exc-1.exp remote: stop reason and watchpoint data address per thread New vCtrlC packet, non-stop mode equivalent of \003 gdbserver crash if gdb attaches too fast gdbserver resume_stop handling bug Make dprintf-non-stop.exp cope with remote testing Remote thread create/exit events gdbserver: fix killed-outside.exp testsuite: Range stepping and non-stop mode infrun: Fix TARGET_WAITKIND_NO_RESUMED handling in non-stop mode Implement TARGET_WAITKIND_NO_RESUMED in the remote protocol gdbserver:prepare_access_memory: pick another thread gdbserver/linux: Always wake up event loop after resume gdbserver: don't exit until GDB disconnects remote: enable "maint set target-non-stop" by default gdb/NEWS | 28 ++ gdb/doc/gdb.texinfo | 123 +++++++- gdb/gdbserver/gdbthread.h | 4 + gdb/gdbserver/inferiors.c | 23 ++ gdb/gdbserver/linux-low.c | 180 ++++++++--- gdb/gdbserver/mem-break.c | 17 +- gdb/gdbserver/remote-utils.c | 21 +- gdb/gdbserver/server.c | 151 ++++++--- gdb/gdbserver/server.h | 1 + gdb/gdbserver/target.c | 107 +++++++ gdb/gdbserver/target.h | 14 +- gdb/gdbthread.h | 7 +- gdb/infcmd.c | 101 ++++-- gdb/inferior.h | 12 + gdb/infrun.c | 150 ++++++++- gdb/infrun.h | 6 + gdb/remote-notif.c | 4 +- gdb/remote.c | 438 ++++++++++++++++++++++----- gdb/target-delegates.c | 28 ++ gdb/target.c | 8 + gdb/target.h | 5 + gdb/target/waitstatus.c | 5 + gdb/target/waitstatus.h | 8 +- gdb/testsuite/gdb.base/dprintf-non-stop.exp | 10 +- gdb/testsuite/gdb.mi/mi-nonstop.exp | 11 +- gdb/testsuite/lib/gdb.exp | 20 +- gdb/testsuite/lib/mi-support.exp | 9 + gdb/testsuite/lib/range-stepping-support.exp | 7 +- gdb/thread.c | 16 + 29 files changed, 1266 insertions(+), 248 deletions(-) -- 1.9.3