From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8620 invoked by alias); 21 Jun 2013 17:25:20 -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 8262 invoked by uid 89); 21 Jun 2013 17:25:17 -0000 X-Spam-SWARE-Status: No, score=-7.6 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; Fri, 21 Jun 2013 17:25:17 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5LHPGJC032047 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Jun 2013 13:25:16 -0400 Received: from barimba.redhat.com (ovpn-113-102.phx2.redhat.com [10.3.113.102]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5LHPBSx021447; Fri, 21 Jun 2013 13:25:15 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 07/16] push last_pass_packet into struct remote_state Date: Fri, 21 Jun 2013 17:25:00 -0000 Message-Id: <1371835506-15691-8-git-send-email-tromey@redhat.com> In-Reply-To: <1371835506-15691-1-git-send-email-tromey@redhat.com> References: <1371835506-15691-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-06/txt/msg00616.txt.bz2 This moves the global last_pass_packet into remote_state. * remote.c (struct remote_state) : New field. (last_pass_packet): Remove. (remote_pass_signals, remote_open_1): Update. --- gdb/remote.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index ba8cbfa..c60eb13 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -381,6 +381,8 @@ struct remote_state /* This is the traceframe which we last selected on the remote system. It will be -1 if no traceframe is selected. */ int remote_traceframe_number; + + char *last_pass_packet; }; /* Private data that we'll store in (struct thread_info)->private. */ @@ -1653,8 +1655,6 @@ record_currthread (struct remote_state *rs, ptid_t currthread) rs->general_thread = currthread; } -static char *last_pass_packet; - /* If 'QPassSignals' is supported, tell the remote stub what signals it can simply pass through to the inferior without reporting. */ @@ -1665,6 +1665,7 @@ remote_pass_signals (int numsigs, unsigned char *pass_signals) { char *pass_packet, *p; int count = 0, i; + struct remote_state *rs = get_remote_state (); gdb_assert (numsigs < 256); for (i = 0; i < numsigs; i++) @@ -1690,17 +1691,16 @@ remote_pass_signals (int numsigs, unsigned char *pass_signals) } } *p = 0; - if (!last_pass_packet || strcmp (last_pass_packet, pass_packet)) + if (!rs->last_pass_packet || strcmp (rs->last_pass_packet, pass_packet)) { - struct remote_state *rs = get_remote_state (); char *buf = rs->buf; putpkt (pass_packet); getpkt (&rs->buf, &rs->buf_size, 0); packet_ok (buf, &remote_protocol_packets[PACKET_QPassSignals]); - if (last_pass_packet) - xfree (last_pass_packet); - last_pass_packet = pass_packet; + if (rs->last_pass_packet) + xfree (rs->last_pass_packet); + rs->last_pass_packet = pass_packet; } else xfree (pass_packet); @@ -4281,8 +4281,8 @@ remote_open_1 (char *name, int from_tty, target_preopen (from_tty); /* Make sure we send the passed signals list the next time we resume. */ - xfree (last_pass_packet); - last_pass_packet = NULL; + xfree (rs->last_pass_packet); + rs->last_pass_packet = NULL; /* Make sure we send the program signals list the next time we resume. */ -- 1.8.1.4