From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30157 invoked by alias); 14 May 2013 19:10:44 -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 30147 invoked by uid 89); 14 May 2013 19:10:44 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 14 May 2013 19:10:43 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4EJAgjg030583 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 May 2013 15:10:42 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4EJAfAv014796 for ; Tue, 14 May 2013 15:10:41 -0400 Subject: [PATCH 2/5] Convert rs->support_vCont_t to a struct To: gdb-patches@sourceware.org From: Pedro Alves Date: Tue, 14 May 2013 19:10:00 -0000 Message-ID: <20130514191040.13213.71985.stgit@brno.lan> In-Reply-To: <20130514191026.13213.39574.stgit@brno.lan> References: <20130514191026.13213.39574.stgit@brno.lan> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00487.txt.bz2 Convert the 'support_vCont_t' int field to a struct, in preparation for adding more fields to it. v3: - s/support/supports/ - struct renamed. - comments tweaked. gdb/ 2013-05-14 Yao Qi Pedro Alves * remote.c (struct vCont_action_support): New struct. (struct remote_state) : Remove field. : New field. (remote_vcont_probe, remote_stop_ns): Update. --- gdb/remote.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 7cae940..5d3950b 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -251,6 +251,17 @@ static struct cmd_list_element *remote_cmdlist; static struct cmd_list_element *remote_set_cmdlist; static struct cmd_list_element *remote_show_cmdlist; +/* Stub vCont actions support. + + Each field is a boolean flag indicating whether the stub reports + support for the corresponding action. */ + +struct vCont_action_support +{ + /* vCont;t */ + int t; +}; + /* Description of the remote protocol state for the currently connected target. This is per-target state, and independent of the selected architecture. */ @@ -308,8 +319,8 @@ struct remote_state /* True if the stub reports support for non-stop mode. */ int non_stop_aware; - /* True if the stub reports support for vCont;t. */ - int support_vCont_t; + /* The status of the stub support for the various vCont actions. */ + struct vCont_action_support supports_vCont; /* True if the stub reports support for conditional tracepoints. */ int cond_tracepoints; @@ -4641,7 +4652,7 @@ remote_vcont_probe (struct remote_state *rs) support_S = 0; support_c = 0; support_C = 0; - rs->support_vCont_t = 0; + rs->supports_vCont.t = 0; while (p && *p == ';') { p++; @@ -4654,7 +4665,7 @@ remote_vcont_probe (struct remote_state *rs) else if (*p == 'C' && (*(p + 1) == ';' || *(p + 1) == 0)) support_C = 1; else if (*p == 't' && (*(p + 1) == ';' || *(p + 1) == 0)) - rs->support_vCont_t = 1; + rs->supports_vCont.t = 1; p = strchr (p, ';'); } @@ -5003,7 +5014,7 @@ remote_stop_ns (ptid_t ptid) if (remote_protocol_packets[PACKET_vCont].support == PACKET_SUPPORT_UNKNOWN) remote_vcont_probe (rs); - if (!rs->support_vCont_t) + if (!rs->supports_vCont.t) error (_("Remote server does not support stopping threads")); if (ptid_equal (ptid, minus_one_ptid)