From: Pedro Alves Date: Thu, 29 Oct 2015 12:55:02 +0000 (+0000) Subject: gdbserver: enum gdb_signal casts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e053fbc44f32c12a67f4bcd9f01142b4e043496c;p=binutils-gdb.git 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. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 9b8a7d748a6..1c1f2d8ed6c 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 024399df9dd..3232da18253 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);