Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: dj@redhat.com
Cc: gdb-patches@sourceware.org
Subject: RFA: Stop RX simulator from terminating after completing a non-stopping system call
Date: Wed, 29 Sep 2010 16:15:00 -0000	[thread overview]
Message-ID: <m3vd5oc0qg.fsf@redhat.com> (raw)

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
  	{


             reply	other threads:[~2010-09-29 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29 16:15 Nick Clifton [this message]
2010-09-29 18:43 ` DJ Delorie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3vd5oc0qg.fsf@redhat.com \
    --to=nickc@redhat.com \
    --cc=dj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox