Make target_ops::has_execution take an 'inferior *' instead of a ptid_t
[deliverable/binutils-gdb.git] / sim / common / cgen-trace.c
index 6e2f85605b58d572959ee9e6ecc5ff568792df20..ea7c21b40e4f25dc06bb70e4d8d698efacc4c00a 100644 (file)
@@ -1,5 +1,5 @@
 /* Tracing support for CGEN-based simulators.
-   Copyright (C) 1996-2014 Free Software Foundation, Inc.
+   Copyright (C) 1996-2020 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
@@ -24,9 +24,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-main.h"
 #include "sim-fpu.h"
 
-#undef min
-#define min(a,b) ((a) < (b) ? (a) : (b))
-
 #ifndef SIZE_INSTRUCTION
 #define SIZE_INSTRUCTION 16
 #endif
@@ -66,29 +63,30 @@ static char *bufptr;
 /* Non-zero if this is the first insn in a set of parallel insns.  */
 static int first_insn_p;
 
-/* For communication between trace_insn and trace_result.  */
+/* For communication between cgen_trace_insn and cgen_trace_result.  */
 static int printed_result_p;
 
 /* Insn and its extracted fields.
-   Set by trace_insn, used by trace_insn_fini.
+   Set by cgen_trace_insn, used by cgen_trace_insn_fini.
    ??? Move to SIM_CPU to support heterogeneous multi-cpu case.  */
 static const struct cgen_insn *current_insn;
 static const struct argbuf *current_abuf;
 
 void
-trace_insn_init (SIM_CPU *cpu, int first_p)
+cgen_trace_insn_init (SIM_CPU *cpu, int first_p)
 {
   bufptr = trace_buf;
   *bufptr = 0;
   first_insn_p = first_p;
 
-  /* Set to NULL so trace_insn_fini can know if trace_insn was called.  */
+  /* Set to NULL so cgen_trace_insn_fini can know if cgen_trace_insn was
+     called.  */
   current_insn = NULL;
   current_abuf = NULL;
 }
 
 void
-trace_insn_fini (SIM_CPU *cpu, const struct argbuf *abuf, int last_p)
+cgen_trace_insn_fini (SIM_CPU *cpu, const struct argbuf *abuf, int last_p)
 {
   SIM_DESC sd = CPU_STATE (cpu);
 
@@ -143,7 +141,7 @@ trace_insn_fini (SIM_CPU *cpu, const struct argbuf *abuf, int last_p)
             ++i, ++opinst)
          {
            if (CGEN_OPINST_TYPE (opinst) == CGEN_OPINST_OUTPUT)
-             trace_result (cpu, current_insn, opinst, indices[i]);
+             cgen_trace_result (cpu, current_insn, opinst, indices[i]);
          }
       }
   }
@@ -158,8 +156,8 @@ trace_insn_fini (SIM_CPU *cpu, const struct argbuf *abuf, int last_p)
 }
 
 void
-trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode,
-           const struct argbuf *abuf, IADDR pc)
+cgen_trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode,
+                const struct argbuf *abuf, IADDR pc)
 {
   char disasm_buf[50];
 
@@ -183,7 +181,7 @@ trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode,
 }
 
 void
-trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...)
+cgen_trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...)
 {
   va_list args;
   int printed_one_p = 0;
@@ -222,7 +220,7 @@ trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...)
 }
 
 void
-trace_result (SIM_CPU *cpu, char *name, int type, ...)
+cgen_trace_result (SIM_CPU *cpu, char *name, int type, ...)
 {
   va_list args;
 
@@ -301,18 +299,10 @@ cgen_trace_printf (SIM_CPU *cpu, char *fmt, ...)
 int
 sim_disasm_sprintf (SFILE *f, const char *format, ...)
 {
-#ifndef __STDC__
-  SFILE *f;
-  const char *format;
-#endif
   int n;
   va_list args;
 
-  VA_START (args, format);
-#ifndef __STDC__
-  f = va_arg (args, SFILE *);
-  format = va_arg (args, char *);
-#endif
+  va_start (args, format);
   vsprintf (f->current, format, args);
   f->current += n = strlen (f->current);
   va_end (args);
This page took 0.025304 seconds and 4 git commands to generate.