2001-07-19 18:09:11 +00:00
|
|
|
|
/* Target signal translation functions for GDB.
|
2016-01-01 04:33:14 +00:00
|
|
|
|
Copyright (C) 1990-2016 Free Software Foundation, Inc.
|
2001-07-19 18:09:11 +00:00
|
|
|
|
Contributed by Cygnus Support.
|
|
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-23 18:08:50 +00:00
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2001-07-19 18:09:11 +00:00
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 18:08:50 +00:00
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2001-07-19 18:09:11 +00:00
|
|
|
|
|
2014-09-12 09:11:42 +00:00
|
|
|
|
#include "common-defs.h"
|
2002-03-27 05:12:35 +00:00
|
|
|
|
|
gdb/
* arm-wince-tdep.c: New.
* config/arm/wince.mt (DEPRECATED_TM_FILE): Use tm-arm.h.
(MT_CFLAGS): Delete.
(TM_CLIBS): Delete.
(TDEPFILES): Add arm-wince-tdep.o, corelow.o, solib.o,
solib-legacy.o, solib-svr4.o, and remove wince.o.
* configure.tgt (arm*-*-mingw32ce*): Add.
* signals/signals.c [HAVE_SIGNAL_H]: Check.
(do_target_signal_to_host): Silence 'not used' warning.
* config/arm/tm-wince.h: Remove.
gdb/gdbserver/
* gdbserver/configure.ac: Add errno checking.
(AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
sys/file.h and malloc.h.
(AC_CHECK_DECLS): Add perror.
(srv_mingwce): Handle.
* gdbserver/configure.srv (i[34567]86-*-cygwin*): Add
win32-i386-low.o to srv_tgtobj.
(i[34567]86-*-mingw*): Likewise.
(arm*-*-mingw32ce*): Add case.
* gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
[__MINGW32CE__] (strerror): New function.
[__MINGW32CE__] (errno): Define to GetLastError.
[__MINGW32CE__] (COUNTOF): New macro.
(remote_open): Remove extra close call.
* mem-break.c (delete_breakpoint_at): New function.
* mem-break.h (delete_breakpoint_at): Declare.
* remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
[USE_WIN32API] (read, write): Add char* casts.
* server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
* server.h: Include wincecompat.h on Windows CE.
[HAVE_ERRNO_H]: Check.
(perror): Declare if not declared.
* utils.c: Add stdlib.h, errno.h and malloc.h includes.
(perror_with_name): Remove errno declaration.
* wincecompat.h: New.
* wincecompat.c: New.
* win32-low.h: New.
* win32-arm-low.c: New.
* win32-i386-low.c: New.
(win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
(OUTMSG2): Make it safe.
(_T): New macro.
(COUNTOF): New macro.
(NUM_REGS): Get it from the low target.
(CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
(thread_rec): Let low target handle debug registers.
(child_add_thread): Likewise.
(child_init_thread_list): Likewise.
(continue_one_thread): Likewise.
(regptr): New.
(do_child_fetch_inferior_registers): Move to ...
* win32-i386-low.c: ... here, and rename to ...
(do_fetch_inferior_registers): ... this.
* win32-low.c (child_fetch_inferior_registers):
Go through the low target.
(do_child_store_inferior_registers): Use regptr.
(strwinerror): New function.
(win32_create_inferior): Handle Windows CE.
Use strwinerror instead of strerror on Windows error
codes. Add program to the error output.
Don't close the main thread handle on Windows CE.
(win32_attach): Use coredll.dll on Windows CE.
(win32_kill): Close current process and current
thread handles.
(win32_detach): Use coredll.dll on Windows CE.
(win32_resume): Let low target handle debug registers, and
step request.
(handle_exception): Add/Remove initial breakpoint. Avoid
non-existant WSTOPSIG on Windows CE.
(win32_read_inferior_memory): Cast to remove warning.
(win32_arch_string): Go through the low target.
(initialize_low): Call set_breakpoint_data with the low
target's breakpoint.
* win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
FOP_REGNUM, mappings): Move to ...
* win32-i386-low.c: ... here.
* win32-low.c (win32_thread_info): Move to ...
* win32-low.h: ... here.
* Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
win32-arm-low.c and wincecompat.c.
(all:): Add $EXEEXT.
(install-only:): Likewise.
(gdbserver:): Likewise.
(gdbreplay:): Likewise.
* config.in: Regenerate.
* configure: Regenerate.
2007-03-29 01:06:48 +00:00
|
|
|
|
#ifdef HAVE_SIGNAL_H
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#include <signal.h>
|
gdb/
* arm-wince-tdep.c: New.
* config/arm/wince.mt (DEPRECATED_TM_FILE): Use tm-arm.h.
(MT_CFLAGS): Delete.
(TM_CLIBS): Delete.
(TDEPFILES): Add arm-wince-tdep.o, corelow.o, solib.o,
solib-legacy.o, solib-svr4.o, and remove wince.o.
* configure.tgt (arm*-*-mingw32ce*): Add.
* signals/signals.c [HAVE_SIGNAL_H]: Check.
(do_target_signal_to_host): Silence 'not used' warning.
* config/arm/tm-wince.h: Remove.
gdb/gdbserver/
* gdbserver/configure.ac: Add errno checking.
(AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
sys/file.h and malloc.h.
(AC_CHECK_DECLS): Add perror.
(srv_mingwce): Handle.
* gdbserver/configure.srv (i[34567]86-*-cygwin*): Add
win32-i386-low.o to srv_tgtobj.
(i[34567]86-*-mingw*): Likewise.
(arm*-*-mingw32ce*): Add case.
* gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
[__MINGW32CE__] (strerror): New function.
[__MINGW32CE__] (errno): Define to GetLastError.
[__MINGW32CE__] (COUNTOF): New macro.
(remote_open): Remove extra close call.
* mem-break.c (delete_breakpoint_at): New function.
* mem-break.h (delete_breakpoint_at): Declare.
* remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
[USE_WIN32API] (read, write): Add char* casts.
* server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
* server.h: Include wincecompat.h on Windows CE.
[HAVE_ERRNO_H]: Check.
(perror): Declare if not declared.
* utils.c: Add stdlib.h, errno.h and malloc.h includes.
(perror_with_name): Remove errno declaration.
* wincecompat.h: New.
* wincecompat.c: New.
* win32-low.h: New.
* win32-arm-low.c: New.
* win32-i386-low.c: New.
(win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
(OUTMSG2): Make it safe.
(_T): New macro.
(COUNTOF): New macro.
(NUM_REGS): Get it from the low target.
(CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
(thread_rec): Let low target handle debug registers.
(child_add_thread): Likewise.
(child_init_thread_list): Likewise.
(continue_one_thread): Likewise.
(regptr): New.
(do_child_fetch_inferior_registers): Move to ...
* win32-i386-low.c: ... here, and rename to ...
(do_fetch_inferior_registers): ... this.
* win32-low.c (child_fetch_inferior_registers):
Go through the low target.
(do_child_store_inferior_registers): Use regptr.
(strwinerror): New function.
(win32_create_inferior): Handle Windows CE.
Use strwinerror instead of strerror on Windows error
codes. Add program to the error output.
Don't close the main thread handle on Windows CE.
(win32_attach): Use coredll.dll on Windows CE.
(win32_kill): Close current process and current
thread handles.
(win32_detach): Use coredll.dll on Windows CE.
(win32_resume): Let low target handle debug registers, and
step request.
(handle_exception): Add/Remove initial breakpoint. Avoid
non-existant WSTOPSIG on Windows CE.
(win32_read_inferior_memory): Cast to remove warning.
(win32_arch_string): Go through the low target.
(initialize_low): Call set_breakpoint_data with the low
target's breakpoint.
* win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
FOP_REGNUM, mappings): Move to ...
* win32-i386-low.c: ... here.
* win32-low.c (win32_thread_info): Move to ...
* win32-low.h: ... here.
* Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
win32-arm-low.c and wincecompat.c.
(all:): Add $EXEEXT.
(install-only:): Likewise.
(gdbserver:): Likewise.
(gdbreplay:): Likewise.
* config.in: Regenerate.
* configure: Regenerate.
2007-03-29 01:06:48 +00:00
|
|
|
|
#endif
|
2001-07-19 18:09:11 +00:00
|
|
|
|
|
2009-03-02 00:45:13 +00:00
|
|
|
|
#include "gdb_signals.h"
|
|
|
|
|
|
2008-05-01 19:31:52 +00:00
|
|
|
|
struct gdbarch;
|
|
|
|
|
|
2003-03-26 16:29:39 +00:00
|
|
|
|
/* Always use __SIGRTMIN if it's available. SIGRTMIN is the lowest
|
|
|
|
|
_available_ realtime signal, not the lowest supported; glibc takes
|
|
|
|
|
several for its own use. */
|
|
|
|
|
|
|
|
|
|
#ifndef REALTIME_LO
|
|
|
|
|
# if defined(__SIGRTMIN)
|
|
|
|
|
# define REALTIME_LO __SIGRTMIN
|
2006-11-28 19:45:07 +00:00
|
|
|
|
# define REALTIME_HI (__SIGRTMAX + 1)
|
2003-03-26 16:29:39 +00:00
|
|
|
|
# elif defined(SIGRTMIN)
|
2003-03-26 17:21:16 +00:00
|
|
|
|
# define REALTIME_LO SIGRTMIN
|
2006-11-28 19:45:07 +00:00
|
|
|
|
# define REALTIME_HI (SIGRTMAX + 1)
|
2003-03-26 16:29:39 +00:00
|
|
|
|
# endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-01-06 00:57:05 +00:00
|
|
|
|
/* This table must match in order and size the signals in enum
|
2012-05-24 16:39:15 +00:00
|
|
|
|
gdb_signal. */
|
2010-07-31 04:17:44 +00:00
|
|
|
|
|
2009-01-15 22:07:20 +00:00
|
|
|
|
static const struct {
|
infrun debug output: print enum gdb_signal symbol names instead of POSIX signal names.
The other day while debugging something related to random signals, I
got confused with "set debug infrun 1" output, for it said:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal 20
On GNU/Linux, 20 is SIGTSTP. For some reason, it took me a few
minutes to realize that 20 is actually a GDB signal number, not a
target signal number (duh!). In any case, I propose making GDB's
output clearer here:
One way would be to use gdb_signal_to_name, like already used
elsewhere:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal SIGCHLD (20)
but I think that might confuse someone too ("20? Why does GDB believe
SIGCHLD is 20?"). So I thought of printing the enum string instead:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal GDB_SIGNAL_CHLD (20)
Looking at a more complete infrun debug log, we had actually printed
the (POSIX) signal name name a bit before:
infrun: target_wait (-1, status) =
infrun: 9300 [Thread 0x7ffff7fcb740 (LWP 9300)],
infrun: status->kind = stopped, signal = SIGCHLD
...
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal 20
So I'm now thinking that it'd be even better to make infrun output
consistently use the enum symbol string, like so:
infrun: clear_proceed_status_thread (Thread 0x7ffff7fca700 (LWP 25663))
infrun: clear_proceed_status_thread (Thread 0x7ffff7fcb740 (LWP 25659))
- infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1)
+ infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT, step=1)
- infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
+ infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun: 25659 [Thread 0x7ffff7fcb740 (LWP 25659)],
- infrun: status->kind = stopped, signal = SIGCHLD
+ infrun: status->kind = stopped, signal = GDB_SIGNAL_CHLD
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400700
- infrun: random signal 20
+ infrun: random signal (GDB_SIGNAL_CHLD)
infrun: random signal, keep going
- infrun: resume (step=1, signal=20), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
+ infrun: resume (step=1, signal=GDB_SIGNAL_CHLD), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 25659 [Thread 0x7ffff7fcb740 (LWP 25659)],
- infrun: status->kind = stopped, signal = SIGTRAP
+ infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400704
infrun: stepi/nexti
infrun: stop_stepping
GDB's signal numbers are public and hardcoded (see
include/gdb/signals.h), so there's really no need to clutter the
output with numeric values in some places while others not. Replacing
the magic "144" with GDB_SIGNAL_DEFAULT in "proceed"'s debug output
(see above) I think is quite nice.
I posit that all this makes it clearer to newcomers that GDB has its
own signal numbering (and that there must be some mapping going on).
Tested on x86_64 Fedora 17.
gdb/
2013-10-23 Pedro Alves <palves@redhat.com>
* common/gdb_signals.h (gdb_signal_to_symbol_string): Declare.
* common/signals.c: Include "gdb_assert.h".
(signals): New field 'symbol'.
(SET): Use the 'symbol' parameter.
(gdb_signal_to_symbol_string): New function.
* infrun.c (handle_inferior_event) <random signal>: In debug
output, print the random signal enum as string in addition to its
number.
* target/waitstatus.c (target_waitstatus_to_string): Print the
signal's enum value as string instead of the (POSIX) signal name.
2013-10-23 15:14:53 +00:00
|
|
|
|
const char *symbol;
|
2009-01-15 22:07:20 +00:00
|
|
|
|
const char *name;
|
|
|
|
|
const char *string;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
} signals [] =
|
|
|
|
|
{
|
infrun debug output: print enum gdb_signal symbol names instead of POSIX signal names.
The other day while debugging something related to random signals, I
got confused with "set debug infrun 1" output, for it said:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal 20
On GNU/Linux, 20 is SIGTSTP. For some reason, it took me a few
minutes to realize that 20 is actually a GDB signal number, not a
target signal number (duh!). In any case, I propose making GDB's
output clearer here:
One way would be to use gdb_signal_to_name, like already used
elsewhere:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal SIGCHLD (20)
but I think that might confuse someone too ("20? Why does GDB believe
SIGCHLD is 20?"). So I thought of printing the enum string instead:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal GDB_SIGNAL_CHLD (20)
Looking at a more complete infrun debug log, we had actually printed
the (POSIX) signal name name a bit before:
infrun: target_wait (-1, status) =
infrun: 9300 [Thread 0x7ffff7fcb740 (LWP 9300)],
infrun: status->kind = stopped, signal = SIGCHLD
...
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal 20
So I'm now thinking that it'd be even better to make infrun output
consistently use the enum symbol string, like so:
infrun: clear_proceed_status_thread (Thread 0x7ffff7fca700 (LWP 25663))
infrun: clear_proceed_status_thread (Thread 0x7ffff7fcb740 (LWP 25659))
- infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1)
+ infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT, step=1)
- infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
+ infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun: 25659 [Thread 0x7ffff7fcb740 (LWP 25659)],
- infrun: status->kind = stopped, signal = SIGCHLD
+ infrun: status->kind = stopped, signal = GDB_SIGNAL_CHLD
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400700
- infrun: random signal 20
+ infrun: random signal (GDB_SIGNAL_CHLD)
infrun: random signal, keep going
- infrun: resume (step=1, signal=20), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
+ infrun: resume (step=1, signal=GDB_SIGNAL_CHLD), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 25659 [Thread 0x7ffff7fcb740 (LWP 25659)],
- infrun: status->kind = stopped, signal = SIGTRAP
+ infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400704
infrun: stepi/nexti
infrun: stop_stepping
GDB's signal numbers are public and hardcoded (see
include/gdb/signals.h), so there's really no need to clutter the
output with numeric values in some places while others not. Replacing
the magic "144" with GDB_SIGNAL_DEFAULT in "proceed"'s debug output
(see above) I think is quite nice.
I posit that all this makes it clearer to newcomers that GDB has its
own signal numbering (and that there must be some mapping going on).
Tested on x86_64 Fedora 17.
gdb/
2013-10-23 Pedro Alves <palves@redhat.com>
* common/gdb_signals.h (gdb_signal_to_symbol_string): Declare.
* common/signals.c: Include "gdb_assert.h".
(signals): New field 'symbol'.
(SET): Use the 'symbol' parameter.
(gdb_signal_to_symbol_string): New function.
* infrun.c (handle_inferior_event) <random signal>: In debug
output, print the random signal enum as string in addition to its
number.
* target/waitstatus.c (target_waitstatus_to_string): Print the
signal's enum value as string instead of the (POSIX) signal name.
2013-10-23 15:14:53 +00:00
|
|
|
|
#define SET(symbol, constant, name, string) { #symbol, name, string },
|
2010-07-31 04:17:44 +00:00
|
|
|
|
#include "gdb/signals.def"
|
|
|
|
|
#undef SET
|
2001-07-19 18:09:11 +00:00
|
|
|
|
};
|
|
|
|
|
|
infrun debug output: print enum gdb_signal symbol names instead of POSIX signal names.
The other day while debugging something related to random signals, I
got confused with "set debug infrun 1" output, for it said:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal 20
On GNU/Linux, 20 is SIGTSTP. For some reason, it took me a few
minutes to realize that 20 is actually a GDB signal number, not a
target signal number (duh!). In any case, I propose making GDB's
output clearer here:
One way would be to use gdb_signal_to_name, like already used
elsewhere:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal SIGCHLD (20)
but I think that might confuse someone too ("20? Why does GDB believe
SIGCHLD is 20?"). So I thought of printing the enum string instead:
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal GDB_SIGNAL_CHLD (20)
Looking at a more complete infrun debug log, we had actually printed
the (POSIX) signal name name a bit before:
infrun: target_wait (-1, status) =
infrun: 9300 [Thread 0x7ffff7fcb740 (LWP 9300)],
infrun: status->kind = stopped, signal = SIGCHLD
...
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x323d4e8b94
infrun: random signal 20
So I'm now thinking that it'd be even better to make infrun output
consistently use the enum symbol string, like so:
infrun: clear_proceed_status_thread (Thread 0x7ffff7fca700 (LWP 25663))
infrun: clear_proceed_status_thread (Thread 0x7ffff7fcb740 (LWP 25659))
- infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1)
+ infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT, step=1)
- infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
+ infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun: 25659 [Thread 0x7ffff7fcb740 (LWP 25659)],
- infrun: status->kind = stopped, signal = SIGCHLD
+ infrun: status->kind = stopped, signal = GDB_SIGNAL_CHLD
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400700
- infrun: random signal 20
+ infrun: random signal (GDB_SIGNAL_CHLD)
infrun: random signal, keep going
- infrun: resume (step=1, signal=20), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
+ infrun: resume (step=1, signal=GDB_SIGNAL_CHLD), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 25659)] at 0x400700
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 25659 [Thread 0x7ffff7fcb740 (LWP 25659)],
- infrun: status->kind = stopped, signal = SIGTRAP
+ infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400704
infrun: stepi/nexti
infrun: stop_stepping
GDB's signal numbers are public and hardcoded (see
include/gdb/signals.h), so there's really no need to clutter the
output with numeric values in some places while others not. Replacing
the magic "144" with GDB_SIGNAL_DEFAULT in "proceed"'s debug output
(see above) I think is quite nice.
I posit that all this makes it clearer to newcomers that GDB has its
own signal numbering (and that there must be some mapping going on).
Tested on x86_64 Fedora 17.
gdb/
2013-10-23 Pedro Alves <palves@redhat.com>
* common/gdb_signals.h (gdb_signal_to_symbol_string): Declare.
* common/signals.c: Include "gdb_assert.h".
(signals): New field 'symbol'.
(SET): Use the 'symbol' parameter.
(gdb_signal_to_symbol_string): New function.
* infrun.c (handle_inferior_event) <random signal>: In debug
output, print the random signal enum as string in addition to its
number.
* target/waitstatus.c (target_waitstatus_to_string): Print the
signal's enum value as string instead of the (POSIX) signal name.
2013-10-23 15:14:53 +00:00
|
|
|
|
const char *
|
|
|
|
|
gdb_signal_to_symbol_string (enum gdb_signal sig)
|
|
|
|
|
{
|
|
|
|
|
gdb_assert ((int) sig >= GDB_SIGNAL_FIRST && (int) sig <= GDB_SIGNAL_LAST);
|
|
|
|
|
|
|
|
|
|
return signals[sig].symbol;
|
|
|
|
|
}
|
2001-07-19 18:09:11 +00:00
|
|
|
|
|
|
|
|
|
/* Return the string for a signal. */
|
2009-01-15 22:07:20 +00:00
|
|
|
|
const char *
|
2012-05-24 16:39:15 +00:00
|
|
|
|
gdb_signal_to_string (enum gdb_signal sig)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
{
|
2012-05-24 16:51:47 +00:00
|
|
|
|
if ((int) sig >= GDB_SIGNAL_FIRST && (int) sig <= GDB_SIGNAL_LAST)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return signals[sig].string;
|
|
|
|
|
else
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return signals[GDB_SIGNAL_UNKNOWN].string;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the name for a signal. */
|
2009-01-15 22:07:20 +00:00
|
|
|
|
const char *
|
2012-05-24 16:39:15 +00:00
|
|
|
|
gdb_signal_to_name (enum gdb_signal sig)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
{
|
2012-05-24 16:51:47 +00:00
|
|
|
|
if ((int) sig >= GDB_SIGNAL_FIRST && (int) sig <= GDB_SIGNAL_LAST
|
2002-01-13 21:58:16 +00:00
|
|
|
|
&& signals[sig].name != NULL)
|
2002-01-13 21:11:38 +00:00
|
|
|
|
return signals[sig].name;
|
|
|
|
|
else
|
2002-01-13 21:58:16 +00:00
|
|
|
|
/* I think the code which prints this will always print it along
|
|
|
|
|
with the string, so no need to be verbose (very old comment). */
|
|
|
|
|
return "?";
|
2001-07-19 18:09:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Given a name, return its signal. */
|
2012-05-24 16:39:15 +00:00
|
|
|
|
enum gdb_signal
|
|
|
|
|
gdb_signal_from_name (const char *name)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
{
|
2012-05-24 16:39:15 +00:00
|
|
|
|
enum gdb_signal sig;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
|
|
|
|
|
/* It's possible we also should allow "SIGCLD" as well as "SIGCHLD"
|
2012-05-24 16:51:47 +00:00
|
|
|
|
for GDB_SIGNAL_SIGCHLD. SIGIOT, on the other hand, is more
|
2001-07-19 18:09:11 +00:00
|
|
|
|
questionable; seems like by now people should call it SIGABRT
|
|
|
|
|
instead. */
|
|
|
|
|
|
|
|
|
|
/* This ugly cast brought to you by the native VAX compiler. */
|
2012-05-24 16:51:47 +00:00
|
|
|
|
for (sig = GDB_SIGNAL_HUP;
|
|
|
|
|
sig < GDB_SIGNAL_LAST;
|
2012-05-24 16:39:15 +00:00
|
|
|
|
sig = (enum gdb_signal) ((int) sig + 1))
|
2002-05-09 22:20:29 +00:00
|
|
|
|
if (signals[sig].name != NULL
|
|
|
|
|
&& strcmp (name, signals[sig].name) == 0)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return sig;
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_UNKNOWN;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The following functions are to help certain targets deal
|
|
|
|
|
with the signal/waitstatus stuff. They could just as well be in
|
|
|
|
|
a file called native-utils.c or unixwaitstatus-utils.c or whatever. */
|
|
|
|
|
|
|
|
|
|
/* Convert host signal to our signals. */
|
2012-05-24 16:39:15 +00:00
|
|
|
|
enum gdb_signal
|
|
|
|
|
gdb_signal_from_host (int hostsig)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
{
|
2014-06-09 09:34:33 +00:00
|
|
|
|
/* A switch statement would make sense but would require special
|
|
|
|
|
kludges to deal with the cases where more than one signal has the
|
|
|
|
|
same number. Signals are ordered ANSI-standard signals first,
|
|
|
|
|
other signals second, with signals in each block ordered by their
|
|
|
|
|
numerical values on a typical POSIX platform. */
|
2001-07-19 18:09:11 +00:00
|
|
|
|
|
|
|
|
|
if (hostsig == 0)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_0;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
|
2014-06-09 09:34:33 +00:00
|
|
|
|
/* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
|
|
|
|
|
are ANSI-standard signals and are always available. */
|
|
|
|
|
if (hostsig == SIGINT)
|
|
|
|
|
return GDB_SIGNAL_INT;
|
|
|
|
|
if (hostsig == SIGILL)
|
|
|
|
|
return GDB_SIGNAL_ILL;
|
|
|
|
|
if (hostsig == SIGABRT)
|
|
|
|
|
return GDB_SIGNAL_ABRT;
|
|
|
|
|
if (hostsig == SIGFPE)
|
|
|
|
|
return GDB_SIGNAL_FPE;
|
|
|
|
|
if (hostsig == SIGSEGV)
|
|
|
|
|
return GDB_SIGNAL_SEGV;
|
|
|
|
|
if (hostsig == SIGTERM)
|
|
|
|
|
return GDB_SIGNAL_TERM;
|
|
|
|
|
|
|
|
|
|
/* All other signals need preprocessor conditionals. */
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#if defined (SIGHUP)
|
|
|
|
|
if (hostsig == SIGHUP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_HUP;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGQUIT)
|
|
|
|
|
if (hostsig == SIGQUIT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_QUIT;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGTRAP)
|
|
|
|
|
if (hostsig == SIGTRAP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_TRAP;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGEMT)
|
|
|
|
|
if (hostsig == SIGEMT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_EMT;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGKILL)
|
|
|
|
|
if (hostsig == SIGKILL)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_KILL;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGBUS)
|
|
|
|
|
if (hostsig == SIGBUS)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_BUS;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGSYS)
|
|
|
|
|
if (hostsig == SIGSYS)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_SYS;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPIPE)
|
|
|
|
|
if (hostsig == SIGPIPE)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_PIPE;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGALRM)
|
|
|
|
|
if (hostsig == SIGALRM)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_ALRM;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGUSR1)
|
|
|
|
|
if (hostsig == SIGUSR1)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_USR1;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGUSR2)
|
|
|
|
|
if (hostsig == SIGUSR2)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_USR2;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGCLD)
|
|
|
|
|
if (hostsig == SIGCLD)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_CHLD;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGCHLD)
|
|
|
|
|
if (hostsig == SIGCHLD)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_CHLD;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPWR)
|
|
|
|
|
if (hostsig == SIGPWR)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_PWR;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGWINCH)
|
|
|
|
|
if (hostsig == SIGWINCH)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_WINCH;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGURG)
|
|
|
|
|
if (hostsig == SIGURG)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_URG;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGIO)
|
|
|
|
|
if (hostsig == SIGIO)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_IO;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPOLL)
|
|
|
|
|
if (hostsig == SIGPOLL)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_POLL;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGSTOP)
|
|
|
|
|
if (hostsig == SIGSTOP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_STOP;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGTSTP)
|
|
|
|
|
if (hostsig == SIGTSTP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_TSTP;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGCONT)
|
|
|
|
|
if (hostsig == SIGCONT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_CONT;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGTTIN)
|
|
|
|
|
if (hostsig == SIGTTIN)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_TTIN;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGTTOU)
|
|
|
|
|
if (hostsig == SIGTTOU)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_TTOU;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGVTALRM)
|
|
|
|
|
if (hostsig == SIGVTALRM)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_VTALRM;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPROF)
|
|
|
|
|
if (hostsig == SIGPROF)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_PROF;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGXCPU)
|
|
|
|
|
if (hostsig == SIGXCPU)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_XCPU;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGXFSZ)
|
|
|
|
|
if (hostsig == SIGXFSZ)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_XFSZ;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGWIND)
|
|
|
|
|
if (hostsig == SIGWIND)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_WIND;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPHONE)
|
|
|
|
|
if (hostsig == SIGPHONE)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_PHONE;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGLOST)
|
|
|
|
|
if (hostsig == SIGLOST)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_LOST;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGWAITING)
|
|
|
|
|
if (hostsig == SIGWAITING)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_WAITING;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGCANCEL)
|
|
|
|
|
if (hostsig == SIGCANCEL)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_CANCEL;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGLWP)
|
|
|
|
|
if (hostsig == SIGLWP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_LWP;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGDANGER)
|
|
|
|
|
if (hostsig == SIGDANGER)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_DANGER;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGGRANT)
|
|
|
|
|
if (hostsig == SIGGRANT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_GRANT;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGRETRACT)
|
|
|
|
|
if (hostsig == SIGRETRACT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_RETRACT;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGMSG)
|
|
|
|
|
if (hostsig == SIGMSG)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_MSG;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGSOUND)
|
|
|
|
|
if (hostsig == SIGSOUND)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_SOUND;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGSAK)
|
|
|
|
|
if (hostsig == SIGSAK)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_SAK;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPRIO)
|
|
|
|
|
if (hostsig == SIGPRIO)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_PRIO;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Mach exceptions. Assumes that the values for EXC_ are positive! */
|
|
|
|
|
#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
|
|
|
|
|
if (hostsig == _NSIG + EXC_BAD_ACCESS)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
return GDB_EXC_BAD_ACCESS;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
|
|
|
|
|
if (hostsig == _NSIG + EXC_BAD_INSTRUCTION)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
return GDB_EXC_BAD_INSTRUCTION;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_ARITHMETIC) && defined (_NSIG)
|
|
|
|
|
if (hostsig == _NSIG + EXC_ARITHMETIC)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
return GDB_EXC_ARITHMETIC;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_EMULATION) && defined (_NSIG)
|
|
|
|
|
if (hostsig == _NSIG + EXC_EMULATION)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
return GDB_EXC_EMULATION;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_SOFTWARE) && defined (_NSIG)
|
|
|
|
|
if (hostsig == _NSIG + EXC_SOFTWARE)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
return GDB_EXC_SOFTWARE;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_BREAKPOINT) && defined (_NSIG)
|
|
|
|
|
if (hostsig == _NSIG + EXC_BREAKPOINT)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
return GDB_EXC_BREAKPOINT;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined (SIGINFO)
|
|
|
|
|
if (hostsig == SIGINFO)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_INFO;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined (REALTIME_LO)
|
|
|
|
|
if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
|
|
|
|
|
{
|
2012-05-24 16:51:47 +00:00
|
|
|
|
/* This block of GDB_SIGNAL_REALTIME value is in order. */
|
2001-07-19 18:09:11 +00:00
|
|
|
|
if (33 <= hostsig && hostsig <= 63)
|
2012-05-24 16:39:15 +00:00
|
|
|
|
return (enum gdb_signal)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
(hostsig - 33 + (int) GDB_SIGNAL_REALTIME_33);
|
2001-07-19 18:09:11 +00:00
|
|
|
|
else if (hostsig == 32)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_REALTIME_32;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
else if (64 <= hostsig && hostsig <= 127)
|
2012-05-24 16:39:15 +00:00
|
|
|
|
return (enum gdb_signal)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
(hostsig - 64 + (int) GDB_SIGNAL_REALTIME_64);
|
2001-07-19 18:09:11 +00:00
|
|
|
|
else
|
2012-05-24 16:39:15 +00:00
|
|
|
|
error (_("GDB bug: target.c (gdb_signal_from_host): "
|
2011-03-18 13:03:31 +00:00
|
|
|
|
"unrecognized real-time signal"));
|
2001-07-19 18:09:11 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-05-24 16:51:47 +00:00
|
|
|
|
return GDB_SIGNAL_UNKNOWN;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-24 16:39:15 +00:00
|
|
|
|
/* Convert a OURSIG (an enum gdb_signal) to the form used by the
|
2001-07-19 18:09:11 +00:00
|
|
|
|
target operating system (refered to as the ``host'') or zero if the
|
|
|
|
|
equivalent host signal is not available. Set/clear OURSIG_OK
|
|
|
|
|
accordingly. */
|
|
|
|
|
|
|
|
|
|
static int
|
2012-05-24 16:39:15 +00:00
|
|
|
|
do_gdb_signal_to_host (enum gdb_signal oursig,
|
2001-07-19 18:09:11 +00:00
|
|
|
|
int *oursig_ok)
|
|
|
|
|
{
|
2003-03-26 20:44:39 +00:00
|
|
|
|
int retsig;
|
gdb/
* arm-wince-tdep.c: New.
* config/arm/wince.mt (DEPRECATED_TM_FILE): Use tm-arm.h.
(MT_CFLAGS): Delete.
(TM_CLIBS): Delete.
(TDEPFILES): Add arm-wince-tdep.o, corelow.o, solib.o,
solib-legacy.o, solib-svr4.o, and remove wince.o.
* configure.tgt (arm*-*-mingw32ce*): Add.
* signals/signals.c [HAVE_SIGNAL_H]: Check.
(do_target_signal_to_host): Silence 'not used' warning.
* config/arm/tm-wince.h: Remove.
gdb/gdbserver/
* gdbserver/configure.ac: Add errno checking.
(AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
sys/file.h and malloc.h.
(AC_CHECK_DECLS): Add perror.
(srv_mingwce): Handle.
* gdbserver/configure.srv (i[34567]86-*-cygwin*): Add
win32-i386-low.o to srv_tgtobj.
(i[34567]86-*-mingw*): Likewise.
(arm*-*-mingw32ce*): Add case.
* gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
[__MINGW32CE__] (strerror): New function.
[__MINGW32CE__] (errno): Define to GetLastError.
[__MINGW32CE__] (COUNTOF): New macro.
(remote_open): Remove extra close call.
* mem-break.c (delete_breakpoint_at): New function.
* mem-break.h (delete_breakpoint_at): Declare.
* remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
[USE_WIN32API] (read, write): Add char* casts.
* server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
* server.h: Include wincecompat.h on Windows CE.
[HAVE_ERRNO_H]: Check.
(perror): Declare if not declared.
* utils.c: Add stdlib.h, errno.h and malloc.h includes.
(perror_with_name): Remove errno declaration.
* wincecompat.h: New.
* wincecompat.c: New.
* win32-low.h: New.
* win32-arm-low.c: New.
* win32-i386-low.c: New.
(win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
(OUTMSG2): Make it safe.
(_T): New macro.
(COUNTOF): New macro.
(NUM_REGS): Get it from the low target.
(CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
(thread_rec): Let low target handle debug registers.
(child_add_thread): Likewise.
(child_init_thread_list): Likewise.
(continue_one_thread): Likewise.
(regptr): New.
(do_child_fetch_inferior_registers): Move to ...
* win32-i386-low.c: ... here, and rename to ...
(do_fetch_inferior_registers): ... this.
* win32-low.c (child_fetch_inferior_registers):
Go through the low target.
(do_child_store_inferior_registers): Use regptr.
(strwinerror): New function.
(win32_create_inferior): Handle Windows CE.
Use strwinerror instead of strerror on Windows error
codes. Add program to the error output.
Don't close the main thread handle on Windows CE.
(win32_attach): Use coredll.dll on Windows CE.
(win32_kill): Close current process and current
thread handles.
(win32_detach): Use coredll.dll on Windows CE.
(win32_resume): Let low target handle debug registers, and
step request.
(handle_exception): Add/Remove initial breakpoint. Avoid
non-existant WSTOPSIG on Windows CE.
(win32_read_inferior_memory): Cast to remove warning.
(win32_arch_string): Go through the low target.
(initialize_low): Call set_breakpoint_data with the low
target's breakpoint.
* win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
FOP_REGNUM, mappings): Move to ...
* win32-i386-low.c: ... here.
* win32-low.c (win32_thread_info): Move to ...
* win32-low.h: ... here.
* Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
win32-arm-low.c and wincecompat.c.
(all:): Add $EXEEXT.
(install-only:): Likewise.
(gdbserver:): Likewise.
(gdbreplay:): Likewise.
* config.in: Regenerate.
* configure: Regenerate.
2007-03-29 01:06:48 +00:00
|
|
|
|
/* Silence the 'not used' warning, for targets that
|
|
|
|
|
do not support signals. */
|
|
|
|
|
(void) retsig;
|
2003-03-26 20:44:39 +00:00
|
|
|
|
|
2014-06-09 09:34:33 +00:00
|
|
|
|
/* Signals are ordered ANSI-standard signals first, other signals
|
|
|
|
|
second, with signals in each block ordered by their numerical
|
|
|
|
|
values on a typical POSIX platform. */
|
|
|
|
|
|
2001-07-19 18:09:11 +00:00
|
|
|
|
*oursig_ok = 1;
|
|
|
|
|
switch (oursig)
|
|
|
|
|
{
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_0:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
2014-06-09 09:34:33 +00:00
|
|
|
|
/* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
|
|
|
|
|
are ANSI-standard signals and are always available. */
|
|
|
|
|
case GDB_SIGNAL_INT:
|
|
|
|
|
return SIGINT;
|
|
|
|
|
case GDB_SIGNAL_ILL:
|
|
|
|
|
return SIGILL;
|
|
|
|
|
case GDB_SIGNAL_ABRT:
|
|
|
|
|
return SIGABRT;
|
|
|
|
|
case GDB_SIGNAL_FPE:
|
|
|
|
|
return SIGFPE;
|
|
|
|
|
case GDB_SIGNAL_SEGV:
|
|
|
|
|
return SIGSEGV;
|
|
|
|
|
case GDB_SIGNAL_TERM:
|
|
|
|
|
return SIGTERM;
|
|
|
|
|
|
|
|
|
|
/* All other signals need preprocessor conditionals. */
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#if defined (SIGHUP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_HUP:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGHUP;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGQUIT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_QUIT:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGQUIT;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGTRAP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_TRAP:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGTRAP;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGEMT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_EMT:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGEMT;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGKILL)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_KILL:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGKILL;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGBUS)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_BUS:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGBUS;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGSYS)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_SYS:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGSYS;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPIPE)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_PIPE:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGPIPE;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGALRM)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_ALRM:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGALRM;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGUSR1)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_USR1:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGUSR1;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGUSR2)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_USR2:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGUSR2;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGCHLD) || defined (SIGCLD)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_CHLD:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#if defined (SIGCHLD)
|
|
|
|
|
return SIGCHLD;
|
|
|
|
|
#else
|
|
|
|
|
return SIGCLD;
|
|
|
|
|
#endif
|
|
|
|
|
#endif /* SIGCLD or SIGCHLD */
|
|
|
|
|
#if defined (SIGPWR)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_PWR:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGPWR;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGWINCH)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_WINCH:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGWINCH;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGURG)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_URG:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGURG;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGIO)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_IO:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGIO;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPOLL)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_POLL:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGPOLL;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGSTOP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_STOP:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGSTOP;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGTSTP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_TSTP:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGTSTP;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGCONT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_CONT:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGCONT;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGTTIN)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_TTIN:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGTTIN;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGTTOU)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_TTOU:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGTTOU;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGVTALRM)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_VTALRM:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGVTALRM;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPROF)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_PROF:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGPROF;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGXCPU)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_XCPU:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGXCPU;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGXFSZ)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_XFSZ:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGXFSZ;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGWIND)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_WIND:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGWIND;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPHONE)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_PHONE:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGPHONE;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGLOST)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_LOST:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGLOST;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGWAITING)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_WAITING:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGWAITING;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGCANCEL)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_CANCEL:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGCANCEL;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGLWP)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_LWP:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGLWP;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGDANGER)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_DANGER:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGDANGER;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGGRANT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_GRANT:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGGRANT;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGRETRACT)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_RETRACT:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGRETRACT;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGMSG)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_MSG:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGMSG;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGSOUND)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_SOUND:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGSOUND;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGSAK)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_SAK:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGSAK;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (SIGPRIO)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_PRIO:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGPRIO;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Mach exceptions. Assumes that the values for EXC_ are positive! */
|
|
|
|
|
#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
case GDB_EXC_BAD_ACCESS:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return _NSIG + EXC_BAD_ACCESS;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
case GDB_EXC_BAD_INSTRUCTION:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return _NSIG + EXC_BAD_INSTRUCTION;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_ARITHMETIC) && defined (_NSIG)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
case GDB_EXC_ARITHMETIC:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return _NSIG + EXC_ARITHMETIC;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_EMULATION) && defined (_NSIG)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
case GDB_EXC_EMULATION:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return _NSIG + EXC_EMULATION;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_SOFTWARE) && defined (_NSIG)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
case GDB_EXC_SOFTWARE:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return _NSIG + EXC_SOFTWARE;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined (EXC_BREAKPOINT) && defined (_NSIG)
|
2013-10-22 11:16:51 +00:00
|
|
|
|
case GDB_EXC_BREAKPOINT:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return _NSIG + EXC_BREAKPOINT;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined (SIGINFO)
|
2012-05-24 16:51:47 +00:00
|
|
|
|
case GDB_SIGNAL_INFO:
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return SIGINFO;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
#if defined (REALTIME_LO)
|
2003-03-26 20:44:39 +00:00
|
|
|
|
retsig = 0;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
|
2012-05-24 16:51:47 +00:00
|
|
|
|
if (oursig >= GDB_SIGNAL_REALTIME_33
|
|
|
|
|
&& oursig <= GDB_SIGNAL_REALTIME_63)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
{
|
|
|
|
|
/* This block of signals is continuous, and
|
2012-05-24 16:51:47 +00:00
|
|
|
|
GDB_SIGNAL_REALTIME_33 is 33 by definition. */
|
|
|
|
|
retsig = (int) oursig - (int) GDB_SIGNAL_REALTIME_33 + 33;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
}
|
2012-05-24 16:51:47 +00:00
|
|
|
|
else if (oursig == GDB_SIGNAL_REALTIME_32)
|
2002-06-09 19:42:11 +00:00
|
|
|
|
{
|
2012-05-24 16:51:47 +00:00
|
|
|
|
/* GDB_SIGNAL_REALTIME_32 isn't contiguous with
|
|
|
|
|
GDB_SIGNAL_REALTIME_33. It is 32 by definition. */
|
2003-03-26 20:44:39 +00:00
|
|
|
|
retsig = 32;
|
2002-06-09 19:42:11 +00:00
|
|
|
|
}
|
2012-05-24 16:51:47 +00:00
|
|
|
|
else if (oursig >= GDB_SIGNAL_REALTIME_64
|
|
|
|
|
&& oursig <= GDB_SIGNAL_REALTIME_127)
|
2002-06-09 19:42:11 +00:00
|
|
|
|
{
|
|
|
|
|
/* This block of signals is continuous, and
|
2012-05-24 16:51:47 +00:00
|
|
|
|
GDB_SIGNAL_REALTIME_64 is 64 by definition. */
|
|
|
|
|
retsig = (int) oursig - (int) GDB_SIGNAL_REALTIME_64 + 64;
|
2002-06-09 19:42:11 +00:00
|
|
|
|
}
|
2003-03-26 20:44:39 +00:00
|
|
|
|
|
|
|
|
|
if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
|
|
|
|
|
return retsig;
|
2001-07-19 18:09:11 +00:00
|
|
|
|
#endif
|
2003-03-26 16:29:39 +00:00
|
|
|
|
|
2001-07-19 18:09:11 +00:00
|
|
|
|
*oursig_ok = 0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2012-05-24 16:39:15 +00:00
|
|
|
|
gdb_signal_to_host_p (enum gdb_signal oursig)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
{
|
|
|
|
|
int oursig_ok;
|
2012-05-24 16:39:15 +00:00
|
|
|
|
do_gdb_signal_to_host (oursig, &oursig_ok);
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return oursig_ok;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2012-05-24 16:39:15 +00:00
|
|
|
|
gdb_signal_to_host (enum gdb_signal oursig)
|
2001-07-19 18:09:11 +00:00
|
|
|
|
{
|
|
|
|
|
int oursig_ok;
|
2012-05-24 16:39:15 +00:00
|
|
|
|
int targ_signo = do_gdb_signal_to_host (oursig, &oursig_ok);
|
2001-07-19 18:09:11 +00:00
|
|
|
|
if (!oursig_ok)
|
|
|
|
|
{
|
|
|
|
|
/* The user might be trying to do "signal SIGSAK" where this system
|
|
|
|
|
doesn't have SIGSAK. */
|
2011-03-18 13:03:31 +00:00
|
|
|
|
warning (_("Signal %s does not exist on this system."),
|
2012-05-24 16:39:15 +00:00
|
|
|
|
gdb_signal_to_name (oursig));
|
2001-07-19 18:09:11 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return targ_signo;
|
|
|
|
|
}
|