From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15478 invoked by alias); 24 Jun 2003 23:03:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8346 invoked from network); 24 Jun 2003 22:17:11 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 24 Jun 2003 22:17:11 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h5OMHBH18491 for ; Tue, 24 Jun 2003 18:17:11 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5OMGuS07834; Tue, 24 Jun 2003 18:16:56 -0400 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h5OMGuK11099; Tue, 24 Jun 2003 15:16:56 -0700 Message-ID: <3EF8CDD7.7060103@redhat.com> Date: Tue, 24 Jun 2003 23:03:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Cagney CC: Kazu Hirata , gdb-patches@sources.redhat.com, rsandifo@redhat.com, aoliva@redhat.com, vinschen@redhat.com, dvenkat@noida.hcltech.com Subject: Re: [preliminary patch] sim/h8300/compile.c: abort when abort is called. References: <20030624.035043.10249396.kazu@cs.umass.edu> <3EF87254.1060900@redhat.com> Content-Type: multipart/mixed; boundary="------------070207020907050800000401" X-SW-Source: 2003-06/txt/msg00762.txt.bz2 This is a multi-part message in MIME format. --------------070207020907050800000401 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 751 Andrew Cagney wrote: >> Hi, >> >> Attached is a patch to teach the h8300 simulator to abort when abort >> is called. Without this, I get spurious XPASS when testing gcc. >> Although the patched simulator works, my gut feeling is telling me >> that there should be a better way to do this. Any thought? > > > Yes. Generally speaking, the simulators should not call abort. Instead > they should, some how, stop the simulation and return to the caller. > That statement looks to be trying to do just that. I think MichaelS > recently changed sim/common to, for the h8300 do a correct exit. Yeah, and I didn't think about the stop signal, but it seems like we're ready to do that too. Kazu, try this, and with your approval I'll check it in. --------------070207020907050800000401 Content-Type: text/plain; name="signals" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="signals" Content-length: 1826 2003-06-24 Michael Snyder * sim-main.h (SIM_WIFSTOPPED, SIM_WSTOPSIG): Define. * compile.c (sim_resume): Use the above to return stop signal. Index: sim-main.h =================================================================== RCS file: /cvs/cvsfiles/devo/sim/h8sx/sim-main.h,v retrieving revision 1.13 diff -p -r1.13 sim-main.h *** sim-main.h 2003/06/18 11:51:39 1.13 --- sim-main.h 2003/06/24 22:13:22 *************** struct sim_state { *** 164,170 **** /* Local version of macros for decoding exit status. (included here rather than try to find target version of wait.h) */ ! #define SIM_WIFEXITED(V) (((V) & 0xff) == 0) ! #define SIM_WEXITSTATUS(V) ((V) >> 8) #endif /* SIM_MAIN_H */ --- 164,172 ---- /* Local version of macros for decoding exit status. (included here rather than try to find target version of wait.h) */ ! #define SIM_WIFEXITED(V) (((V) & 0xff) == 0) ! #define SIM_WIFSTOPPED(V) (!SIM_WIFEXITED (V)) ! #define SIM_WEXITSTATUS(V) (((V) >> 8) & 0xff) ! #define SIM_WSTOPSIG(V) ((V) & 0x7f) #endif /* SIM_MAIN_H */ Index: compile.c =================================================================== RCS file: /cvs/cvsfiles/devo/sim/h8sx/compile.c,v retrieving revision 1.84 diff -p -r1.84 compile.c *** compile.c 2003/06/19 04:18:52 1.84 --- compile.c 2003/06/24 22:13:22 *************** sim_resume (SIM_DESC sd, int step, int s *** 3575,3580 **** --- 3575,3586 ---- sim_engine_set_run_state (sd, sim_exited, SIM_WEXITSTATUS (h8_get_reg (sd, 0))); } + else if (SIM_WIFSTOPPED (h8_get_reg (sd, 0))) + { + /* Pass the stop signal up to gdb. */ + sim_engine_set_run_state (sd, sim_stopped, + SIM_WSTOPSIG (h8_get_reg (sd, 0))); + } else { /* Treat it as a sigtrap. */ --------------070207020907050800000401--