From e053fbc44f32c12a67f4bcd9f01142b4e043496c Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 29 Oct 2015 12:55:02 +0000 Subject: [PATCH] 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 * server.c (handle_v_cont, process_serial_event): Add enum gdb_signal casts to signal parsing code. --- gdb/gdbserver/ChangeLog | 5 +++++ 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 + * server.c (handle_v_cont, process_serial_event): Add enum + gdb_signal casts to signal parsing code. + +2015-10-29 Pedro Alves + * 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); -- 2.7.4