#endif
/* Text is queued in TRACE_BUF because we want to output the insn's cycle
- count first but that isn't know until after the insn has executed. */
+ count first but that isn't known until after the insn has executed. */
static char trace_buf[1024];
/* If NULL, output to stdout directly. */
static char *bufptr;
if (CPU_PROFILE_FLAGS (cpu) [PROFILE_MODEL_IDX])
{
unsigned long total = PROFILE_TOTAL_CYCLE_COUNT (CPU_PROFILE_DATA (cpu));
- fprintf (stderr, "%-*ld %-*ld ",
- SIZE_CYCLE_COUNT, total - last_cycle_count,
- SIZE_TOTAL_CYCLE_COUNT, total);
+ trace_printf (cpu, "%-*ld %-*ld ",
+ SIZE_CYCLE_COUNT, total - last_cycle_count,
+ SIZE_TOTAL_CYCLE_COUNT, total);
last_cycle_count = total;
}
- fputs (trace_buf, stderr);
- fputc ('\n', stderr);
+ trace_printf (cpu, "%s\n", trace_buf);
}
/* For communication between trace_insn and trace_result. */
va_start (args, name);
- cgen_trace_printf (cpu, "0x%.*x: %s ", SIZE_PC, pc, name);
+ trace_printf (cpu, "Extract: 0x%.*x: %s ", SIZE_PC, pc, name);
do {
int type,ival;
if (fmt)
{
if (printed_one_p)
- cgen_trace_printf (cpu, ", ");
+ trace_printf (cpu, ", ");
printed_one_p = 1;
type = va_arg (args, int);
switch (type)
{
case 'x' :
ival = va_arg (args, int);
- cgen_trace_printf (cpu, fmt, ival);
+ trace_printf (cpu, fmt, ival);
break;
default :
abort ();
} while (fmt);
va_end (args);
- cgen_trace_printf (cpu, "\n");
+ trace_printf (cpu, "\n");
}
void
va_end (args);
}
+/* Print trace output to BUFPTR if active, otherwise print normally.
+ This is only for tracing semantic code. */
+
void
cgen_trace_printf (SIM_CPU *cpu, char *fmt, ...)
{