From: Michael Snyder <msnyder@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: Kazu Hirata <kazu@cs.umass.edu>,
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.
Date: Tue, 24 Jun 2003 23:03:00 -0000 [thread overview]
Message-ID: <3EF8CDD7.7060103@redhat.com> (raw)
In-Reply-To: <3EF87254.1060900@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 751 bytes --]
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.
[-- Attachment #2: signals --]
[-- Type: text/plain, Size: 1826 bytes --]
2003-06-24 Michael Snyder <msnyder@redhat.com>
* 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. */
next prev parent reply other threads:[~2003-06-24 23:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-24 8:14 Kazu Hirata
2003-06-24 16:18 ` Andrew Cagney
2003-06-24 23:03 ` Michael Snyder [this message]
2003-06-25 21:39 ` Kazu Hirata
2003-07-02 19:06 ` Michael Snyder
2003-06-24 23:04 ` Michael Snyder
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=3EF8CDD7.7060103@redhat.com \
--to=msnyder@redhat.com \
--cc=ac131313@redhat.com \
--cc=aoliva@redhat.com \
--cc=dvenkat@noida.hcltech.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kazu@cs.umass.edu \
--cc=rsandifo@redhat.com \
--cc=vinschen@redhat.com \
/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