]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Clarify meaning of sim_signalled's SIGRC argument. Document that this
authorAndrew Cagney <cagney@redhat.com>
Sat, 22 Nov 1997 12:52:44 +0000 (12:52 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 22 Nov 1997 12:52:44 +0000 (12:52 +0000)
isn't possible in sim-reason.c and just return the target SIGRC
instead.

For simulators that rely on sim-reason.c, replace SIG* with SIM_SIG*.

Hack nrun.c so that when it is executed (ARGV[0]) as `step' instead
of `run' it single steps the simulator.  Allows testing of single step
without full GDB.

include/remote-sim.h
sim/common/ChangeLog
sim/common/Make-common.in
sim/tic80/ChangeLog
sim/tic80/insns
sim/tic80/interp.c
sim/tic80/sim-calls.c
sim/tic80/sim-main.h

index c4fecc0ec3934a2dfe74852e0f0a442ecf50d8cd..a785437e94b7c7ef5eae175cdef85e245f3b9a91 100644 (file)
@@ -223,8 +223,11 @@ int sim_stop PARAMS ((SIM_DESC sd));
    undefined memory region (SIGSEGV); Mis-aligned memory access
    (SIGBUS).
 
-   SIM_SIGNALLED: The simulator encountered target code that requires
-   the signal SIGRC to be delivered to the simulated program.
+   SIM_SIGNALLED: The program has stopped. The simulator has
+   encountered target code that requires the (HOST) signal SIGRC to be
+   delivered to the simulated program.  Ex: `kill (getpid (),
+   TARGET_SIGxxx)'.  Where TARGET_SIGxxx has been translated into a
+   host signal.  FIXME: This is not always possible..
 
    SIM_RUNNING, SIM_POLLING: The return of one of these values
    indicates a problem internal to the simulator. */
index 966b0ea8f793ebc953baa0c9257026bbaccb1d24..7e6908430fdb54fd1adc3d82d500b04feb20e4c3 100644 (file)
@@ -1,3 +1,15 @@
+Sat Nov 22 19:16:54 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * sim-reason.c (sim_stop_reason): For sim_signalled, terurn the
+       signal untranslated, document problem with this.
+
+       * nrun.c (main): Check for a prog name of `*step'.  If present,
+       step the simulator instead of allowing it to run free.
+
+       * sim-signal.c (SIGQUIT): Define on _MSC_VER hosts.
+
+       * Make-common.in (sim_main_headers): Add sim-signal.h.
+
 Fri Nov 21 09:32:32 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * sim-signal.c (sim_signal_to_host): Return 0 for SIM_SIGNONE.
index 344edade2640f37746de82ab3d0f9c436e4bfff2..c359bacc9260dbb9963d0acba1ba6183dd30f859 100644 (file)
@@ -254,6 +254,7 @@ sim_main_headers = \
        $(srccom)/sim-config.h \
        $(srccom)/sim-base.h \
        $(srccom)/sim-basics.h \
+       $(srccom)/sim-signal.h \
        $(srccom)/sim-memopt.h \
        $(srccom)/sim-model.h \
        $(srccom)/sim-module.h \
index 3eae822fa79cb8f2ca1773ef874af2e4ee27e8a0..e7c56d6bd4378acd66bbb287c6b1979eaee22336 100644 (file)
@@ -1,3 +1,17 @@
+Sat Nov 22 21:42:09 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * interp.c (engine_step): Replace SIGTRAP with SIM_SIGTRAP.
+       (engine_run_until_stop): Replace SIGINT with SIM_SIGINT.
+
+       * sim-main.h: Include sim-signal.h.
+       (SIGTRAP): Delete definition.
+
+       * interp.c, sim-calls.c: Do not include signal.h.
+
+       * insns (illegal): SIGILL -> SIM_SIGILL.
+       (fp_unavailable): SIGFPE -> SIM_SIGFPE.
+       (do_trap): SIGTRAP -> SIM_SIGTRAP.
+       
 Tue Nov 18 15:33:48 1997  Doug Evans  <devans@canuck.cygnus.com>
 
        * sim-main.h (CIA_ADDR): Define.
index 894902a6efc089a8272c1c5aee5ca21ac84b1e41..dfe9c87ecbe93d69186c346d6331b2dca00d582f 100644 (file)
 // The following is called when ever an illegal instruction is encountered.
 :internal::::illegal:
        sim_io_eprintf (SD, "0x%lx: illegal instruction\n", (unsigned long) cia.ip);
-       sim_engine_halt (SD, CPU, NULL, cia, sim_signalled, SIGILL);
+       sim_engine_halt (SD, CPU, NULL, cia, sim_signalled, SIM_SIGILL);
 
 // The following is called when ever an FP op is attempted with FPU disabled.
 :internal::::fp_unavailable:
        sim_io_eprintf (SD, "0x%lx: floating-point unavailable\n", (unsigned long) cia.ip);
-       sim_engine_halt (SD, CPU, NULL, cia, sim_signalled, SIGFPE);
+       sim_engine_halt (SD, CPU, NULL, cia, sim_signalled, SIM_SIGFPE);
 
 // Handle a branch instruction
 :function:::instruction_address:do_branch:int annul, address_word target, int rLink_p, unsigned32 *rLink
@@ -1229,7 +1229,7 @@ void::function::do_trap:unsigned32 trap_number
              }
            break;
          case 73:
-           sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIGTRAP);
+           sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIM_SIGTRAP);
 
          /* Add a few traps for now to print the register state */
          case 74:
index 24c86f600526e01fdf54d9cd08f513bd465eee7c..17f06d486c2b11d579a11c3999950200de1870fc 100644 (file)
@@ -26,8 +26,6 @@
 #include "idecode.h"
 #include "itable.h"
 
-#include <signal.h>
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #else
@@ -103,7 +101,7 @@ engine_run_until_stop (SIM_DESC sd,
          cia = idecode_issue (sd, insn, cia);
        }
       while (*keep_running);
-      engine_halt (sd, cpu, cia, sim_stopped, SIGINT);
+      engine_halt (sd, cpu, cia, sim_stopped, SIM_SIGINT);
     }
 }
 
@@ -122,9 +120,8 @@ engine_step (SIM_DESC sd)
       cia = cpu->cia;
       insn = IMEM (cia);
       cia = idecode_issue (sd, insn, cia);
-      engine_halt (sd, cpu, cia, sim_stopped, SIGTRAP);
+      engine_halt (sd, cpu, cia, sim_stopped, SIM_SIGTRAP);
     }
 }
 
 #endif
-
index 55f04964da15363ddb00b8e482ea5a33b501917b..310dc709a927b8f674ae063f6543ff4860aa6500 100644 (file)
@@ -20,7 +20,6 @@
     */
 
 
-#include <signal.h> /* FIXME - should be machine dependant version */
 #include <stdarg.h>
 #include <ctype.h>
 
index 228ad9abbf605963bfb4860744078397600ec3c2..67db35354415c7461ee651cb03e6a5107d61542e 100644 (file)
 
 
 #include "sim-basics.h"
+#include "sim-signal.h"
+
+#include <signal.h> /* For kill() in insns:do_trap */
 
-#include <signal.h>
 #include <errno.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -77,7 +79,3 @@ extern void engine_init
 #define kill(sig, pid) (errno = EINVAL, -1)
 #endif
 #endif
-
-#ifndef SIGTRAP
-# define SIGTRAP 5
-#endif