This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 07/16] push last_pass_packet into struct remote_state
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Fri, 28 Jun 2013 11:40:20 -0600
- Subject: [PATCH 07/16] push last_pass_packet into struct remote_state
- References: <1372441229-305-1-git-send-email-tromey at redhat dot com>
This moves the global last_pass_packet into remote_state.
* remote.c (struct remote_state) <last_pass_packet>:
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 3ef99df..136c3d9 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -380,6 +380,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. */
@@ -1652,8 +1654,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. */
@@ -1664,6 +1664,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++)
@@ -1689,17 +1690,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);
@@ -4283,8 +4283,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