void hw_vabort (struct hw *me, const char *fmt, va_list ap) { const char *name; char *msg; /* find an identity */ if (me != NULL && hw_path (me) != NULL && hw_path (me) [0] != '\0') name = hw_path (me); else if (me != NULL && hw_name (me) != NULL && hw_name (me)[0] != '\0') name = hw_name (me); else if (me != NULL && hw_family (me) != NULL && hw_family (me)[0] != '\0') name = hw_family (me); else name = "device"; /* construct an updated format string */ msg = alloca (strlen (name) + strlen (": ") + strlen (fmt) + 1); strcpy (msg, name); strcat (msg, ": "); strcat (msg, fmt); /* report the problem */ sim_engine_vabort (hw_system (me), STATE_HW (hw_system (me))->cpu, STATE_HW (hw_system (me))->cia, msg, ap); }
void sim_engine_abort (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, const char *fmt, ...) { va_list ap; ASSERT (sd == NULL || STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); va_start (ap, fmt); sim_engine_vabort (sd, cpu, cia, fmt, ap); va_end (ap); }
void sim_hw_abort (struct sim_state *sd, struct hw *me, const char *fmt, ...) { va_list ap; va_start (ap, fmt); if (me == NULL) sim_engine_vabort (sd, NULL, NULL_CIA, fmt, ap); else hw_vabort (me, fmt, ap); va_end (ap); }