This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Stop RX simulator from terminating after completing a non-stopping system call


Hi DJ,

  Currently the RX simulator will stop after completing the emulation of
  any system call, not just ones that are supposed to stop it (SYS_exit,
  SYS_kill).  This is because code in decode_opcode() unconditionally
  uses the DO_RETURN macro without checking the return code from
  rx_syscall().

  The patch below fixes the problem by adding a check for the
  RX_MAKE_STEPPED return code and proceeding as normal if this code is
  returned.

  Checked by running hello world built by an rx-elf toolchain.

  OK to apply ?

Cheers
  Nick

sim/rx/ChangeLog
2010-09-29  Nick Clifton  <nickc@redhat.com>

	* rx.c (decode_opcode: RXO_int): Only break out of the emulation
	loop if rx_syscall() does not return a RX_STEPPED result.

Index: sim/rx/rx.c
===================================================================
RCS file: /cvs/src/src/sim/rx/rx.c,v
retrieving revision 1.9
diff -c -3 -p -r1.9 rx.c
*** sim/rx/rx.c	24 Sep 2010 05:18:23 -0000	1.9
--- sim/rx/rx.c	29 Sep 2010 10:10:26 -0000
*************** decode_opcode ()
*** 1232,1238 ****
        v = GS ();
        if (v == 255)
  	{
! 	  DO_RETURN (rx_syscall (regs.r[5]));
  	}
        else
  	{
--- 1232,1240 ----
        v = GS ();
        if (v == 255)
  	{
! 	  int rc = rx_syscall (regs.r[5]);
! 	  if (! RX_STEPPED (rc))
! 	    DO_RETURN (rc);
  	}
        else
  	{


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]