From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21774 invoked by alias); 29 Sep 2010 10:17:56 -0000 Received: (qmail 21762 invoked by uid 22791); 29 Sep 2010 10:17:55 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Sep 2010 10:17:48 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8TAHk8a005367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Sep 2010 06:17:46 -0400 Received: from Gift.redhat.com (vpn1-5-89.ams2.redhat.com [10.36.5.89]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8TAHigI022876; Wed, 29 Sep 2010 06:17:45 -0400 From: Nick Clifton 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 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00486.txt.bz2 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 * 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 {