[binutils-gdb] sim: mn10300: add SIGTRAP fallback

Michael Frysinger vapier@sourceware.org
Sat May 29 19:32:09 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fc23e71a17c38150bfad9e520f81f839fc2df4d8

commit fc23e71a17c38150bfad9e520f81f839fc2df4d8
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sat May 29 15:22:17 2021 -0400

    sim: mn10300: add SIGTRAP fallback
    
    This is a bit of a hack, but it matches the hack we use in other
    places in the sim currently.  This fixes building for e.g. Windows.
    The signal fallback logic needs a bit of love in general at some
    point across all sim code.

Diff:
---
 sim/mn10300/ChangeLog | 4 ++++
 sim/mn10300/interp.c  | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index dbb5b6d5ac7..1f5753feaaf 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-29  Mike Frysinger  <vapier@gentoo.org>
+
+	* interp.c [!SIGTRAP] (SIGTRAP): Define to 5.
+
 2021-05-17  Mike Frysinger  <vapier@gentoo.org>
 
 	* sim-main.h (SIM_HAVE_COMMON_SIM_STATE): Delete.
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c
index b6c5d5b087e..541d4b14668 100644
--- a/sim/mn10300/interp.c
+++ b/sim/mn10300/interp.c
@@ -464,6 +464,9 @@ mn10300_cpu_exception_resume(SIM_DESC sd, sim_cpu* cpu, int exception)
 
   if(exception == 0 && State.exc_suspended > 0)
     {
+#ifndef SIGTRAP
+# define SIGTRAP 5
+#endif
       if(State.exc_suspended != SIGTRAP) /* warn not for breakpoints */
          sim_io_eprintf(sd, "Warning, resuming but ignoring pending exception signal (%d)\n",
   		       State.exc_suspended);


More information about the Gdb-cvs mailing list