From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32478 invoked by alias); 28 Jun 2013 17:40:48 -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 32453 invoked by uid 89); 28 Jun 2013 17:40:48 -0000 X-Spam-SWARE-Status: No, score=-7.4 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, 28 Jun 2013 17:40:47 +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 r5SHeijp020862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 28 Jun 2013 13:40:45 -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 r5SHea0X010167; Fri, 28 Jun 2013 13:40:44 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 08/16] push last_program_signals_packet into struct remote_state Date: Fri, 28 Jun 2013 17:40:00 -0000 Message-Id: <1372441229-305-9-git-send-email-tromey@redhat.com> In-Reply-To: <1372441229-305-1-git-send-email-tromey@redhat.com> References: <1372441229-305-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-06/txt/msg00901.txt.bz2 This moves the global last_program_signals_packet into remote_state. * remote.c (struct remote_state) : New field. (last_program_signals_packet): Remove. (remote_program_signals, remote_open_1): Update. --- gdb/remote.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 136c3d9..a2d7e13 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -382,6 +382,12 @@ struct remote_state int remote_traceframe_number; char *last_pass_packet; + + /* The last QProgramSignals packet sent to the target. We bypass + sending a new program signals list down to the target if the new + packet is exactly the same as the last we sent. IOW, we only let + the target know about program signals list changes. */ + char *last_program_signals_packet; }; /* Private data that we'll store in (struct thread_info)->private. */ @@ -1706,13 +1712,6 @@ remote_pass_signals (int numsigs, unsigned char *pass_signals) } } -/* The last QProgramSignals packet sent to the target. We bypass - sending a new program signals list down to the target if the new - packet is exactly the same as the last we sent. IOW, we only let - the target know about program signals list changes. */ - -static char *last_program_signals_packet; - /* If 'QProgramSignals' is supported, tell the remote stub what signals it should pass through to the inferior when detaching. */ @@ -1723,6 +1722,7 @@ remote_program_signals (int numsigs, unsigned char *signals) { char *packet, *p; int count = 0, i; + struct remote_state *rs = get_remote_state (); gdb_assert (numsigs < 256); for (i = 0; i < numsigs; i++) @@ -1748,17 +1748,16 @@ remote_program_signals (int numsigs, unsigned char *signals) } } *p = 0; - if (!last_program_signals_packet - || strcmp (last_program_signals_packet, packet) != 0) + if (!rs->last_program_signals_packet + || strcmp (rs->last_program_signals_packet, packet) != 0) { - struct remote_state *rs = get_remote_state (); char *buf = rs->buf; putpkt (packet); getpkt (&rs->buf, &rs->buf_size, 0); packet_ok (buf, &remote_protocol_packets[PACKET_QProgramSignals]); - xfree (last_program_signals_packet); - last_program_signals_packet = packet; + xfree (rs->last_program_signals_packet); + rs->last_program_signals_packet = packet; } else xfree (packet); @@ -4288,8 +4287,8 @@ remote_open_1 (char *name, int from_tty, /* Make sure we send the program signals list the next time we resume. */ - xfree (last_program_signals_packet); - last_program_signals_packet = NULL; + xfree (rs->last_program_signals_packet); + rs->last_program_signals_packet = NULL; remote_fileio_reset (); reopen_exec_file (); -- 1.8.1.4