[PATCH] include/remote-sim.h: Clarify sim_resume / sim_stop_reason

Andrew Cagney ac131313@cygnus.com
Sat Apr 1 00:00:00 GMT 2000


Hello,

include/remote-sim.h defines the interface between gdb and the builtin
simulators.  This patch clarifies slightly part of the interface.

While remote-sim.h is part of GDB its in a BINUTILS directory :-)  Shall
we make it that I'm responsible for that and the other gdb<->sim
interface files?

	enjoy,
		Andrew
Tue Feb  8 17:01:13 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* remote-sim.h (sim_resume): Clarify use of SIGGNAL.
	(sim_stop_reason): Clarify meaning of sim_signalled.

Index: include/remote-sim.h
===================================================================
RCS file: /cvs/cvsfiles/devo/include/remote-sim.h,v
retrieving revision 1.21
diff -p -r1.21 remote-sim.h
*** remote-sim.h	1998/11/11 05:58:03	1.21
--- remote-sim.h	2000/02/09 03:35:46
*************** int sim_store_register PARAMS ((SIM_DESC
*** 211,218 ****
  void sim_info PARAMS ((SIM_DESC sd, int verbose));
  
  
! /* Run (or resume) the simulated program.  */
  
  void sim_resume PARAMS ((SIM_DESC sd, int step, int siggnal));
  
  
--- 211,238 ----
  void sim_info PARAMS ((SIM_DESC sd, int verbose));
  
  
! /* Run (or resume) the simulated program.
  
+    STEP, when non-zero indicates that only a single simulator cycle
+    should be emulated.
+ 
+    SIGGNAL, if non-zero is a (HOST) SIGRC value indicating the type of
+    event (hardware interrupt, signal) to be delivered to the simulated
+    program.
+ 
+    Hardware simulator: If the SIGRC value returned by
+    sim_stop_reason() is passed back to the simulator via SIGGNAL then
+    the hardware simulator shall correctly deliver the hardware event
+    indicated by that signal.  If a value of zero is passed in then the
+    simulation will continue as if there were no outstanding signal.
+    The effect of any other SIGGNAL value is is implementation
+    dependant.
+ 
+    Process simulator: If SIGRC is non-zero then the corresponding
+    signal is delivered to the simulated program and execution is then
+    continued.  A zero SIGRC value indicates that the program should
+    continue as normal. */
+ 
  void sim_resume PARAMS ((SIM_DESC sd, int step, int siggnal));
  
  
*************** int sim_stop PARAMS ((SIM_DESC sd));
*** 234,246 ****
     (SIGTRAP); a completed single step (SIGTRAP); an internal error
     condition (SIGABRT); an illegal instruction (SIGILL); Access to an
     undefined memory region (SIGSEGV); Mis-aligned memory access
!    (SIGBUS).
! 
!    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. */
--- 254,266 ----
     (SIGTRAP); a completed single step (SIGTRAP); an internal error
     condition (SIGABRT); an illegal instruction (SIGILL); Access to an
     undefined memory region (SIGSEGV); Mis-aligned memory access
!    (SIGBUS).  For some signals information in addition to the signal
!    number may be retained by the simulator (e.g. offending address),
!    that information is not directly accessable via this interface.
! 
!    SIM_SIGNALLED: The program has been terminated by a signal. The
!    simulator has encountered target code that causes the the program
!    to exit with signal SIGRC.
  
     SIM_RUNNING, SIM_POLLING: The return of one of these values
     indicates a problem internal to the simulator. */


More information about the Gdb-patches mailing list