Dejagnu and parallel make tests of gcc

Andrew Cagney ac131313@redhat.com
Thu Sep 26 18:57:00 GMT 2002


>>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




More information about the Gdb-patches mailing list