]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/common/sim-trace.h
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / sim / common / sim-trace.h
index 14d277e2e9e3bd1c34053ca1971213ebf2ea20d2..a8f9172da19447f4298a2702b61149b2dbf5951b 100644 (file)
@@ -1,22 +1,21 @@
 /* Simulator tracing/debugging support.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997-2013 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file is meant to be included by sim-basics.h.  */
 
@@ -63,9 +62,15 @@ enum {
   /* Trace fpu operations.  */
   TRACE_FPU_IDX,
 
+  /* Trace vpu operations.  */
+  TRACE_VPU_IDX,
+
   /* Trace branching.  */
   TRACE_BRANCH_IDX,
 
+  /* Trace syscalls.  */
+  TRACE_SYSCALL_IDX,
+
   /* Add information useful for debugging the simulator to trace output.  */
   TRACE_DEBUG_IDX,
 
@@ -85,8 +90,7 @@ enum {
 ((1 << TRACE_INSN_IDX) \
  | (1 << TRACE_LINENUM_IDX) \
  | (1 << TRACE_MEMORY_IDX) \
- | (1 << TRACE_MODEL_IDX) \
- | (1 << TRACE_EVENTS_IDX))
+ | (1 << TRACE_MODEL_IDX))
 \f
 /* Masks so WITH_TRACE can have symbolic values.
    The case choice here is on purpose.  The lowercase parts are args to
@@ -101,7 +105,9 @@ enum {
 #define TRACE_core     (1 << TRACE_CORE_IDX)
 #define TRACE_events   (1 << TRACE_EVENTS_IDX)
 #define TRACE_fpu      (1 << TRACE_FPU_IDX)
+#define TRACE_vpu      (1 << TRACE_VPU_IDX)
 #define TRACE_branch   (1 << TRACE_BRANCH_IDX)
+#define TRACE_syscall  (1 << TRACE_SYSCALL_IDX)
 #define TRACE_debug    (1 << TRACE_DEBUG_IDX)
 
 /* Preprocessor macros to simplify tests of WITH_TRACE.  */
@@ -115,7 +121,9 @@ enum {
 #define WITH_TRACE_CORE_P      (WITH_TRACE & TRACE_core)
 #define WITH_TRACE_EVENTS_P    (WITH_TRACE & TRACE_events)
 #define WITH_TRACE_FPU_P       (WITH_TRACE & TRACE_fpu)
+#define WITH_TRACE_VPU_P       (WITH_TRACE & TRACE_vpu)
 #define WITH_TRACE_BRANCH_P    (WITH_TRACE & TRACE_branch)
+#define WITH_TRACE_SYSCALL_P   (WITH_TRACE & TRACE_syscall)
 #define WITH_TRACE_DEBUG_P     (WITH_TRACE & TRACE_debug)
 
 /* Tracing install handler.  */
@@ -211,12 +219,12 @@ typedef struct _trace_data {
 #define TRACE_CORE_P(cpu)      TRACE_P (cpu, TRACE_CORE_IDX)
 #define TRACE_EVENTS_P(cpu)    TRACE_P (cpu, TRACE_EVENTS_IDX)
 #define TRACE_FPU_P(cpu)       TRACE_P (cpu, TRACE_FPU_IDX)
+#define TRACE_VPU_P(cpu)       TRACE_P (cpu, TRACE_VPU_IDX)
 #define TRACE_BRANCH_P(cpu)    TRACE_P (cpu, TRACE_BRANCH_IDX)
+#define TRACE_SYSCALL_P(cpu)   TRACE_P (cpu, TRACE_SYSCALL_IDX)
 #define TRACE_DEBUG_P(cpu)     TRACE_P (cpu, TRACE_DEBUG_IDX)
 \f
-/* Traceing functions.
-
- */
+/* Tracing functions.  */
 
 /* Prime the trace buffers ready for any trace output.
    Must be called prior to any other trace operation */
@@ -240,9 +248,26 @@ extern void trace_generic PARAMS ((SIM_DESC sd,
                                   ...))
      __attribute__((format (printf, 4, 5)));
 
+typedef enum {
+  trace_fmt_invalid,
+  trace_fmt_word,
+  trace_fmt_fp,
+  trace_fmt_fpu,
+  trace_fmt_string,
+  trace_fmt_bool,
+  trace_fmt_addr,
+  trace_fmt_instruction_incomplete,
+} data_fmt;
+
 /* Trace a varying number of word sized inputs/outputs.  trace_result*
    must be called to close the trace operation. */
 
+extern void save_data PARAMS ((SIM_DESC sd,
+                               TRACE_DATA *data,
+                               data_fmt fmt,
+                               long size,
+                               const void *buf));
+
 extern void trace_input0 PARAMS ((SIM_DESC sd,
                                  sim_cpu *cpu,
                                  int trace_idx));
@@ -384,14 +409,14 @@ extern void trace_result_word1_string1 PARAMS ((SIM_DESC sd,
 /* Other trace_result{_<type><nr-results>} */
 
 
-/* Macro's for tracing ALU instructions */
+/* Macros for tracing ALU instructions */
 
 #define TRACE_ALU_INPUT0() \
 do { \
   if (TRACE_ALU_P (CPU)) \
     trace_input0 (SD, CPU, TRACE_ALU_IDX); \
 } while (0)
-    
+
 #define TRACE_ALU_INPUT1(V0) \
 do { \
   if (TRACE_ALU_P (CPU)) \
@@ -442,15 +467,28 @@ do { \
     trace_result_word4 (SD, CPU, TRACE_ALU_IDX, (R0), (R1), (R2), (R3)); \
 } while (0)
 
+/* Macros for tracing inputs to comparative branch instructions. */
+
+#define TRACE_BRANCH_INPUT1(V0) \
+do { \
+  if (TRACE_BRANCH_P (CPU)) \
+    trace_input_word1 (SD, CPU, TRACE_BRANCH_IDX, (V0)); \
+} while (0)
+
+#define TRACE_BRANCH_INPUT2(V0,V1) \
+do { \
+  if (TRACE_BRANCH_P (CPU)) \
+    trace_input_word2 (SD, CPU, TRACE_BRANCH_IDX, (V0), (V1)); \
+} while (0)
 
-/* Macro's for tracing FPU instructions */
+/* Macros for tracing FPU instructions */
 
 #define TRACE_FP_INPUT0() \
 do { \
   if (TRACE_FPU_P (CPU)) \
     trace_input0 (SD, CPU, TRACE_FPU_IDX); \
 } while (0)
-    
+
 #define TRACE_FP_INPUT1(V0) \
 do { \
   if (TRACE_FPU_P (CPU)) \
@@ -474,7 +512,7 @@ do { \
   if (TRACE_FPU_P (CPU)) \
     trace_input_word1 (SD, CPU, TRACE_FPU_IDX, (V0)); \
 } while (0)
-    
+
 #define TRACE_FP_RESULT(R0) \
 do { \
   if (TRACE_FPU_P (CPU)) \