Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Jim Wilson <wilson@redhat.com>
Cc: Richard.Earnshaw@arm.com, gcc-patches@gcc.gnu.org,
	gdb-patches@sources.redhat.com
Subject: Re: Dejagnu and parallel make tests of gcc
Date: Thu, 26 Sep 2002 18:57:00 -0000	[thread overview]
Message-ID: <3D93BB04.6090205@redhat.com> (raw)
In-Reply-To: <xwuznu6cd4s.fsf@tonopah.toronto.redhat.com>

>>The problem was the pesky testglue.o file that is used to wrap executables 
>>that are run on the simulator, or other non-native targets.
> 
> 
> By the way, the testglue.o file is only needed for broken simulators and
> broken monitors that are unable to return the process exit code.  It would
> be better to try to fix the broken simulators/monitors than to continue to
> make this hack more complicated.  The hack was added originally because Cygnus
> had no monitor sources, and thus fixing broken monitors was not an option.
> Unfortunately, people then started using it to justify broken simulators,
> and now we have a mess.

Yes.  The simulator just needs to return a correct value via:

/* Fetch the REASON why the program stopped.

    SIM_EXITED: The program has terminated. SIGRC indicates the target
    dependant exit status.

    SIM_STOPPED: The program has stopped.  SIGRC uses the host's signal
    numbering as a way of identifying the reaon: program interrupted by
    user via a sim_stop request (SIGINT); a breakpoint instruction
    (SIGTRAP); a completed single step (SIGTRAP); an internal error
    condition (SIGABRT); an illegal instruction (SIGILL); Access to an
    undefined memory region (SIGSEGV); Mis-aligned memory access
    (SIGBUS).  For some signals information in addition to the signal
    number may be retained by the simulator (e.g. offending address),
    that information is not directly accessable via this interface.

    SIM_SIGNALLED: The program has been terminated by a signal. The
    simulator has encountered target code that causes the the program
    to exit with signal SIGRC.

    SIM_RUNNING, SIM_POLLING: The return of one of these values
    indicates a problem internal to the simulator. */

enum sim_stop { sim_running, sim_polling, sim_exited, sim_stopped, 
sim_signalled
  };

void sim_stop_reason PARAMS ((SIM_DESC sd, enum sim_stop *reason, int 
*sigrc));

when it encounters a an ``exit()'' trap.  See include/gdb/remote-sim.h.

> The way this is supposed to work is that the simulator should return the
> simulated process exit code as its own exit code.  Then we can do testing on
> simulators by doing "sh simulator testcase" instead of "sh testcase".
> The testglue.o file is not needed in this case, and everything works better.
> 
> You can disable use of testglue.o in dejagnu by deleting the line that sets
> needs_status_wrapper to 1.


Andrew



      reply	other threads:[~2002-09-27  1:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-24  8:50 Richard Earnshaw
2002-09-24  9:06 ` Andrew Cagney
2002-09-25  8:17 ` Jim Wilson
2002-09-26 18:57   ` Andrew Cagney [this message]

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=3D93BB04.6090205@redhat.com \
    --to=ac131313@redhat.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=wilson@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