aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-08-14 18:05:51 +0000
committerTom Tromey <tromey@redhat.com>2013-08-14 18:05:51 +0000
commit5e4a05c43186b73c3b4b79cc117ce65f140dbc11 (patch)
tree4a9f600bd939f0b5d1450a1874ac118ac6eb5428 /gdb
parent747dc59d2094de0220383e4ef5e9be9ad72cbe8d (diff)
downloadgdb-5e4a05c43186b73c3b4b79cc117ce65f140dbc11.zip
gdb-5e4a05c43186b73c3b4b79cc117ce65f140dbc11.tar.gz
gdb-5e4a05c43186b73c3b4b79cc117ce65f140dbc11.tar.bz2
push last_program_signals_packet into struct remote_state
This moves the global last_program_signals_packet into remote_state. * remote.c (struct remote_state) <last_program_signals_packet>: New field. (last_program_signals_packet): Remove. (remote_program_signals, remote_open_1): Update.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/remote.c27
2 files changed, 20 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1489d28..5252078 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2013-08-14 Tom Tromey <tromey@redhat.com>
+ * remote.c (struct remote_state) <last_program_signals_packet>:
+ New field.
+ (last_program_signals_packet): Remove.
+ (remote_program_signals, remote_open_1): Update.
+
+2013-08-14 Tom Tromey <tromey@redhat.com>
+
* remote.c (struct remote_state) <last_pass_packet>:
New field.
(last_pass_packet): Remove.
diff --git a/gdb/remote.c b/gdb/remote.c
index 6c12949..ad32e76 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -377,6 +377,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. */
@@ -1703,13 +1709,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. */
@@ -1720,6 +1719,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++)
@@ -1745,17 +1745,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);
@@ -4285,8 +4284,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 ();