mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 00:32:30 +08:00
Revise signal mapping function in GDB interface for RX sim.
sim/rx/gdb-if.c had a function named `rx_signal_to_host'. This function mapped signal numbers used by the BSP to host signal numbers which, at one time a while back, were used by GDB as target signal numbers. This change updates the signal numbers returned to be those names prefixed with "GDB_SIGNAL_" as defined in include/gdb/signals.h. It also changes the name of the function somewhat to better match what the function currently does. I noticed that this function is not static - and there's no reason for it not to be - so I made it static too. * gdb-if.c (rx_signal_to_host): Rename to `rx_signal_to_gdb_signal'. Make static. Update all callers to use new name. Use signal names from include/gdb/signals.h.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2014-02-17 Kevin Buettner <kevinb@redhat.com>
|
||||||
|
|
||||||
|
* gdb-if.c (rx_signal_to_host): Rename to
|
||||||
|
`rx_signal_to_gdb_signal'. Make static. Update all callers
|
||||||
|
to use new name. Use signal names from include/gdb/signals.h.
|
||||||
|
|
||||||
2013-09-23 Alan Modra <amodra@gmail.com>
|
2013-09-23 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* configure: Regenerate.
|
* configure: Regenerate.
|
||||||
|
@ -650,52 +650,35 @@ int siggnal;
|
|||||||
|
|
||||||
|
|
||||||
/* Given a signal number used by the RX bsp (that is, newlib),
|
/* Given a signal number used by the RX bsp (that is, newlib),
|
||||||
return a host signal number. (Oddly, the gdb/sim interface uses
|
return a target signal number used by GDB. */
|
||||||
host signal numbers...) */
|
static int
|
||||||
int
|
rx_signal_to_gdb_signal (int rx)
|
||||||
rx_signal_to_host (int rx)
|
|
||||||
{
|
{
|
||||||
switch (rx)
|
switch (rx)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
#ifdef SIGILL
|
return GDB_SIGNAL_ILL;
|
||||||
return SIGILL;
|
|
||||||
#else
|
|
||||||
return SIGSEGV;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
return SIGTRAP;
|
return GDB_SIGNAL_TRAP;
|
||||||
|
|
||||||
case 10:
|
case 10:
|
||||||
#ifdef SIGBUS
|
return GDB_SIGNAL_BUS;
|
||||||
return SIGBUS;
|
|
||||||
#else
|
|
||||||
return SIGSEGV;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 11:
|
case 11:
|
||||||
return SIGSEGV;
|
return GDB_SIGNAL_SEGV;
|
||||||
|
|
||||||
case 24:
|
case 24:
|
||||||
#ifdef SIGXCPU
|
return GDB_SIGNAL_XCPU;
|
||||||
return SIGXCPU;
|
|
||||||
#else
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
return SIGINT;
|
return GDB_SIGNAL_INT;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
#ifdef SIGFPE
|
return GDB_SIGNAL_FPE;
|
||||||
return SIGFPE;
|
|
||||||
#else
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
return SIGABRT;
|
return GDB_SIGNAL_ABRT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -720,7 +703,7 @@ handle_step (int rc)
|
|||||||
else if (RX_STOPPED (rc))
|
else if (RX_STOPPED (rc))
|
||||||
{
|
{
|
||||||
reason = sim_stopped;
|
reason = sim_stopped;
|
||||||
siggnal = rx_signal_to_host (RX_STOP_SIG (rc));
|
siggnal = rx_signal_to_gdb_signal (RX_STOP_SIG (rc));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user