diff options
author | Pedro Alves <palves@redhat.com> | 2015-10-29 12:55:02 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-10-29 12:56:27 +0000 |
commit | e053fbc44f32c12a67f4bcd9f01142b4e043496c (patch) | |
tree | f360302c3a20dcbe1d81ab8e87e8521d26e91190 | |
parent | add67df84c59a6c28111d65e8d0a7e6b4994cdb1 (diff) | |
download | gdb-e053fbc44f32c12a67f4bcd9f01142b4e043496c.zip gdb-e053fbc44f32c12a67f4bcd9f01142b4e043496c.tar.gz gdb-e053fbc44f32c12a67f4bcd9f01142b4e043496c.tar.bz2 |
gdbserver: enum gdb_signal casts
This is code parsing RSP signal numbers, checking whether the numbers
are indeed valid/known GDB signals, and then converting to host signal
numbers. I considered adding temporary enum gdb_signal variables
instead, but didn't really like the result.
gdb/gdbserver/ChangeLog:
2015-10-29 Pedro Alves <palves@redhat.com>
* server.c (handle_v_cont, process_serial_event): Add enum
gdb_signal casts to signal parsing code.
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/server.c | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 9b8a7d7..1c1f2d8 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,10 @@ 2015-10-29 Pedro Alves <palves@redhat.com> + * server.c (handle_v_cont, process_serial_event): Add enum + gdb_signal casts to signal parsing code. + +2015-10-29 Pedro Alves <palves@redhat.com> + * linux-low.h (NULL_REGSET): Define. * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET. * linux-arm-low.c (arm_regsets): Likewise. diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 024399d..3232da1 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -2555,9 +2555,9 @@ handle_v_cont (char *own_buf) goto err; p = q; - if (!gdb_signal_to_host_p (sig)) + if (!gdb_signal_to_host_p ((enum gdb_signal) sig)) goto err; - resume_info[i].sig = gdb_signal_to_host (sig); + resume_info[i].sig = gdb_signal_to_host ((enum gdb_signal) sig); } else if (p[0] == 'r') { @@ -4039,8 +4039,8 @@ process_serial_event (void) case 'C': require_running (own_buf); hex2bin (own_buf + 1, &sig, 1); - if (gdb_signal_to_host_p (sig)) - signal = gdb_signal_to_host (sig); + if (gdb_signal_to_host_p ((enum gdb_signal) sig)) + signal = gdb_signal_to_host ((enum gdb_signal) sig); else signal = 0; myresume (own_buf, 0, signal); @@ -4048,8 +4048,8 @@ process_serial_event (void) case 'S': require_running (own_buf); hex2bin (own_buf + 1, &sig, 1); - if (gdb_signal_to_host_p (sig)) - signal = gdb_signal_to_host (sig); + if (gdb_signal_to_host_p ((enum gdb_signal) sig)) + signal = gdb_signal_to_host ((enum gdb_signal) sig); else signal = 0; myresume (own_buf, 1, signal); |