diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-11-16 15:08:25 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-11-16 15:08:25 +0000 |
commit | 89be2091496d2a3166460875fea2a2778686f8d3 (patch) | |
tree | 7a337983c051cc05869b6d120f0bc28d4bc3b2a1 /gdb/gdbserver/server.c | |
parent | 869ddf2a184e309b1deb9a8188dac514de6c4261 (diff) | |
download | gdb-89be2091496d2a3166460875fea2a2778686f8d3.zip gdb-89be2091496d2a3166460875fea2a2778686f8d3.tar.gz gdb-89be2091496d2a3166460875fea2a2778686f8d3.tar.bz2 |
gdb/
* remote.c (PACKET_QPassSignals): New.
(last_pass_packet, remote_pass_signals): New.
(remote_protocol_features): Add QPassSignals.
(remote_query_supported): Correct an infinite loop.
(remote_open_1): Reset last_pass_packet.
(remote_resume): Call remote_pass_signals.
(_initialize_remote): Register "set remote pass-signals".
gdb/doc/
* gdb.texinfo (Remote configuration): Mention
"pass-signals-packet".
(General Query Packets): Document QPassSignals. Fix
a typo.
gdb/gdbserver/
* linux-low.c (linux_wait_for_event): Reformat. Use the
pass_signals array.
* remote-utils.c (decode_address_to_semicolon): New.
* server.c (pass_signals, handle_general_set): New.
(handle_query): Mention QPassSignals for qSupported.
(main): Call handle_general_set.
* server.h (pass_signals, decode_address_to_semicolon): New.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r-- | gdb/gdbserver/server.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 5f78736..10a891e 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -36,6 +36,8 @@ unsigned long old_thread_from_wait; int extended_protocol; int server_waiting; +int pass_signals[TARGET_SIGNAL_LAST]; + jmp_buf toplevel; /* The PID of the originally created or attached inferior. Used to @@ -157,6 +159,40 @@ write_qxfer_response (char *buf, unsigned char *data, int len, int is_more) PBUFSIZ - 2) + 1; } +/* Handle all of the extended 'Q' packets. */ +void +handle_general_set (char *own_buf) +{ + if (strncmp ("QPassSignals:", own_buf, strlen ("QPassSignals:")) == 0) + { + int numsigs = (int) TARGET_SIGNAL_LAST, i; + const char *p = own_buf + strlen ("QPassSignals:"); + CORE_ADDR cursig; + + p = decode_address_to_semicolon (&cursig, p); + for (i = 0; i < numsigs; i++) + { + if (i == cursig) + { + pass_signals[i] = 1; + if (*p == '\0') + /* Keep looping, to clear the remaining signals. */ + cursig = -1; + else + p = decode_address_to_semicolon (&cursig, p); + } + else + pass_signals[i] = 0; + } + strcpy (own_buf, "OK"); + return; + } + + /* Otherwise we didn't know what packet it was. Say we didn't + understand it. */ + own_buf[0] = 0; +} + /* Handle all of the extended 'q' packets. */ void handle_query (char *own_buf, int *new_packet_len_p) @@ -248,7 +284,7 @@ handle_query (char *own_buf, int *new_packet_len_p) if (strncmp ("qSupported", own_buf, 10) == 0 && (own_buf[10] == ':' || own_buf[10] == '\0')) { - sprintf (own_buf, "PacketSize=%x", PBUFSIZ - 1); + sprintf (own_buf, "PacketSize=%x;QPassSignals+", PBUFSIZ - 1); if (the_target->read_auxv != NULL) strcat (own_buf, ";qXfer:auxv:read+"); @@ -601,6 +637,9 @@ main (int argc, char *argv[]) case 'q': handle_query (own_buf, &new_packet_len); break; + case 'Q': + handle_general_set (own_buf); + break; case 'd': remote_debug = !remote_debug; break; |