This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
Re: [RFA] Patch for cgen_rtx_error()
- To: Ben Elliston <bje at redhat dot com>
- Subject: Re: [RFA] Patch for cgen_rtx_error()
- From: Doug Evans <dje at transmeta dot com>
- Date: Thu, 26 Oct 2000 19:24:53 -0700 (PDT)
- Cc: "Frank Ch. Eigler" <fche at redhat dot com>, gdb-patches at sources dot redhat dot com, cgen development <cgen at sources dot redhat dot com>
- References: <20001007215114.D31946@redhat.com><Pine.LNX.4.21.0010090828120.26484-100000@moshpit.cygnus.com>
Ben Elliston writes:
> fche wrote:
>
> On Sun, Oct 08, 2000 at 11:38:00AM +1100, Ben Elliston wrote:
>
> > +/* Emit an error message from CGEN RTL. */
> > +
> > +void
> > +cgen_rtx_error (SIM_CPU *cpu, const char * fmt, ...)
> > +{
> > + va_list ap;
> > + va_start(ap, fmt);
> > + sim_io_printf (CPU_STATE (cpu), fmt, ap);
> > + va_end(ap);
> > + sim_io_printf (CPU_STATE (cpu), "\n");
> > +}
>
> Rather than just print the given message (is it really a varargs
> function?), it would be good to do a sim_engine_halt() there too.
>
> Upon further inspection, it seems that the CGEN `error' rtx accepts only a
> single argument, so this function need not accept varargs. Right, Doug?
Can't remember if I've replied to this.
Leaving it as a varargs fn seems ok to me.
[I don't feel like being anally correct on this one.
Maybe the `error' rtx will be varargs some day.]
> Without making assumptions about the architecture of any given port, what
> are you proposing that I pass for the `pc' argument to sim_engine_halt?
> It's wrong to assume that GET_H_PC() and friends will be present.
Maybe the `error' rtx should pass `pc' as an argument.