diff options
author | Tom Tromey <tromey@redhat.com> | 2013-08-14 18:04:52 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-08-14 18:04:52 +0000 |
commit | 747dc59d2094de0220383e4ef5e9be9ad72cbe8d (patch) | |
tree | 470b1d3453fb74269f1bf9b7d8852c1ed0ce7825 | |
parent | 262e11744a20605389113d2859293ccb2651a03f (diff) | |
download | gdb-747dc59d2094de0220383e4ef5e9be9ad72cbe8d.zip gdb-747dc59d2094de0220383e4ef5e9be9ad72cbe8d.tar.gz gdb-747dc59d2094de0220383e4ef5e9be9ad72cbe8d.tar.bz2 |
push last_pass_packet into struct remote_state
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.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/remote.c | 18 |
2 files changed, 16 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 50d1495..1489d28 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_pass_packet>: + New field. + (last_pass_packet): Remove. + (remote_pass_signals, remote_open_1): Update. + +2013-08-14 Tom Tromey <tromey@redhat.com> + * remote.c (struct remote_state) <remote_traceframe_number>: New field. (remote_traceframe_number): Remove. diff --git a/gdb/remote.c b/gdb/remote.c index de74d81..6c12949 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -375,6 +375,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. */ @@ -1649,8 +1651,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. */ @@ -1661,6 +1661,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++) @@ -1686,17 +1687,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); @@ -4280,8 +4280,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. */ |