From patchwork Wed Oct 14 15:28:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 9119 Received: (qmail 71340 invoked by alias); 14 Oct 2015 15:28:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 71258 invoked by uid 89); 14 Oct 2015 15:28:28 -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:27 +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 D2E7DA302C for ; Wed, 14 Oct 2015 15:28:25 +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 t9EFS6Dr016846 for ; Wed, 14 Oct 2015 11:28:25 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 18/18] remote: enable "maint set target-non-stop" by default Date: Wed, 14 Oct 2015 16:28:06 +0100 Message-Id: <1444836486-25679-19-git-send-email-palves@redhat.com> In-Reply-To: <1444836486-25679-1-git-send-email-palves@redhat.com> References: <1444836486-25679-1-git-send-email-palves@redhat.com> ... on remote targets that support it. gdb/ChangeLog: 2015-10-14 Pedro Alves * remote.c (remote_always_non_stop_p): New function. (init_remote_ops): Install it as to_always_non_stop_p method. --- gdb/remote.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gdb/remote.c b/gdb/remote.c index c7a01d2..5e88221 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -11598,6 +11598,20 @@ remote_supports_non_stop (struct target_ops *self) return 1; } +/* to_always_non_stop_p implementation. */ + +static int +remote_always_non_stop_p (struct target_ops *self) +{ + struct remote_state *rs = get_remote_state (); + + /* Only enable if the stub supports the minimum set of optional + packets that make AS/NS possible. */ + return (packet_support (PACKET_QNonStop) == PACKET_ENABLE + && packet_support (PACKET_no_resumed) == PACKET_ENABLE + && packet_support (PACKET_QThreadEvents) == PACKET_ENABLE); +} + static int remote_supports_disable_randomization (struct target_ops *self) { @@ -12986,6 +13000,7 @@ Specify the serial device it is connected to\n\ remote_ops.to_terminal_inferior = remote_terminal_inferior; remote_ops.to_terminal_ours = remote_terminal_ours; remote_ops.to_supports_non_stop = remote_supports_non_stop; + remote_ops.to_always_non_stop_p = remote_always_non_stop_p; remote_ops.to_supports_multi_process = remote_supports_multi_process; remote_ops.to_supports_disable_randomization = remote_supports_disable_randomization;