]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add tracing to r5900 p* instructions.
authorAndrew Cagney <cagney@redhat.com>
Tue, 24 Feb 1998 03:42:27 +0000 (03:42 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 24 Feb 1998 03:42:27 +0000 (03:42 +0000)
sim/common/ChangeLog
sim/common/sim-trace.c
sim/common/sim-trace.h
sim/mips/ChangeLog

index b441c081800722eb1f6b4c7f3a798e3cd5b35eca..c8a2c455a3fcde4657ec4a61059617249ddf4113 100644 (file)
@@ -1,3 +1,10 @@
+Tue Feb 24 13:18:42 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * sim-trace.h (TRACE_ALU_RESULT2): Define.
+       
+       * sim-trace.h, sim-trace.c (trace_result_word2,
+       trace_input_word4, trace_result_word4): New function.
+
 Mon Feb 23 13:08:35 1998  Doug Evans  <devans@canuck.cygnus.com>
 
        * cgen-sim.h (SEM_NEXT_PC): New arg `len'.
index 0990aee5df83524ffe98338d6e31e4842d1ff3fe..10a0508c49d08dee547f643e896ae5025e72ad96 100644 (file)
@@ -438,7 +438,9 @@ print_data (SIM_DESC sd,
            trace_printf (sd, cpu, " 0x%08lx", (long) * (unsigned32*) data);
            break;
          case sizeof (unsigned64):
-           trace_printf (sd, cpu, " 0x%08lx", (long) * (unsigned64*) data);
+           trace_printf (sd, cpu, " 0x%08lx%08lx",
+                         (long) ((* (unsigned64*) data) >> 32),
+                         (long) * (unsigned64*) data);
            break;
          default:
            abort ();
@@ -720,6 +722,23 @@ trace_input_word3 (SIM_DESC sd,
   save_data (sd, data, trace_fmt_word, sizeof (unsigned_word), &d2);
 }
 
+void
+trace_input_word4 (SIM_DESC sd,
+                  sim_cpu *cpu,
+                  int trace_idx,
+                  unsigned_word d0,
+                  unsigned_word d1,
+                  unsigned_word d2,
+                  unsigned_word d3)
+{
+  TRACE_DATA *data = CPU_TRACE_DATA (cpu);
+  TRACE_IDX (data) = trace_idx;
+  save_data (sd, data, trace_fmt_word, sizeof (d0), &d0);
+  save_data (sd, data, trace_fmt_word, sizeof (d1), &d1);
+  save_data (sd, data, trace_fmt_word, sizeof (d2), &d2);
+  save_data (sd, data, trace_fmt_word, sizeof (d3), &d3);
+}
+
 void
 trace_input_bool1 (SIM_DESC sd,
                   sim_cpu *cpu,
@@ -845,6 +864,46 @@ trace_result_word1 (SIM_DESC sd,
   trace_results (sd, cpu, trace_idx, last_input);
 }            
 
+void
+trace_result_word2 (SIM_DESC sd,
+                   sim_cpu *cpu,
+                   int trace_idx,
+                   unsigned_word r0,
+                   unsigned_word r1)
+{
+  TRACE_DATA *data = CPU_TRACE_DATA (cpu);
+  int last_input;
+
+  /* Append any results to the end of the inputs */
+  last_input = TRACE_INPUT_IDX (data);
+  save_data (sd, data, trace_fmt_word, sizeof (r0), &r0);
+  save_data (sd, data, trace_fmt_word, sizeof (r1), &r1);
+
+  trace_results (sd, cpu, trace_idx, last_input);
+}            
+
+void
+trace_result_word4 (SIM_DESC sd,
+                   sim_cpu *cpu,
+                   int trace_idx,
+                   unsigned_word r0,
+                   unsigned_word r1,
+                   unsigned_word r2,
+                   unsigned_word r3)
+{
+  TRACE_DATA *data = CPU_TRACE_DATA (cpu);
+  int last_input;
+
+  /* Append any results to the end of the inputs */
+  last_input = TRACE_INPUT_IDX (data);
+  save_data (sd, data, trace_fmt_word, sizeof (r0), &r0);
+  save_data (sd, data, trace_fmt_word, sizeof (r1), &r1);
+  save_data (sd, data, trace_fmt_word, sizeof (r2), &r2);
+  save_data (sd, data, trace_fmt_word, sizeof (r3), &r3);
+
+  trace_results (sd, cpu, trace_idx, last_input);
+}            
+
 void
 trace_result_bool1 (SIM_DESC sd,
                    sim_cpu *cpu,
index 374681de1197de4407e5227cf87e9bd15d11ffee..0cd344b661abdf9323f7405fbcf22143d28e5e71 100644 (file)
@@ -257,6 +257,19 @@ extern void trace_input_word3 PARAMS ((SIM_DESC sd,
                                       unsigned_word d1,
                                       unsigned_word d2));
 
+extern void trace_input_word4 PARAMS ((SIM_DESC sd,
+                                      sim_cpu *cpu,
+                                      int trace_idx,
+                                      unsigned_word d0,
+                                      unsigned_word d1,
+                                      unsigned_word d2,
+                                      unsigned_word d3));
+
+extern void trace_input_addr1 PARAMS ((SIM_DESC sd,
+                                      sim_cpu *cpu,
+                                      int trace_idx,
+                                      address_word d0));
+
 extern void trace_input_bool1 PARAMS ((SIM_DESC sd,
                                       sim_cpu *cpu,
                                       int trace_idx,
@@ -305,6 +318,20 @@ extern void trace_result_word1 PARAMS ((SIM_DESC sd,
                                        int trace_idx,
                                        unsigned_word r0));
 
+extern void trace_result_word2 PARAMS ((SIM_DESC sd,
+                                       sim_cpu *cpu,
+                                       int trace_idx,
+                                       unsigned_word r0,
+                                       unsigned_word r1));
+
+extern void trace_result_word4 PARAMS ((SIM_DESC sd,
+                                       sim_cpu *cpu,
+                                       int trace_idx,
+                                       unsigned_word r0,
+                                       unsigned_word r1,
+                                       unsigned_word r2,
+                                       unsigned_word r3));
+
 extern void trace_result_bool1 PARAMS ((SIM_DESC sd,
                                        sim_cpu *cpu,
                                        int trace_idx,
@@ -365,12 +392,32 @@ do { \
     trace_input_word3 (SD, CPU, TRACE_ALU_IDX, (V0), (V1), (V2)); \
 } while (0)
 
-#define TRACE_ALU_RESULT(R0) \
+#define TRACE_ALU_INPUT4(V0,V1,V2,V3) \
+do { \
+  if (TRACE_ALU_P (CPU)) \
+    trace_input_word4 (SD, CPU, TRACE_ALU_IDX, (V0), (V1), (V2), (V3)); \
+} while (0)
+
+#define TRACE_ALU_RESULT(R0) TRACE_ALU_RESULT1(R0)
+
+#define TRACE_ALU_RESULT1(R0) \
 do { \
   if (TRACE_ALU_P (CPU)) \
     trace_result_word1 (SD, CPU, TRACE_ALU_IDX, (R0)); \
 } while (0)
 
+#define TRACE_ALU_RESULT2(R0,R1) \
+do { \
+  if (TRACE_ALU_P (CPU)) \
+    trace_result_word2 (SD, CPU, TRACE_ALU_IDX, (R0), (R1)); \
+} while (0)
+
+#define TRACE_ALU_RESULT4(R0,R1,R2,R3) \
+do { \
+  if (TRACE_ALU_P (CPU)) \
+    trace_result_word4 (SD, CPU, TRACE_ALU_IDX, (R0), (R1), (R2), (R3)); \
+} while (0)
+
 
 /* Macro's for tracing FPU instructions */
 
index 231891e095110dfa67acc3a0d201c326450075c9..2f04fb5a1e18a7e7e9de79f5a3b5355519df3d0d 100644 (file)
@@ -1,4 +1,8 @@
 start-sanitize-r5900
+Tue Feb 24 14:44:18 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * r5900.igen: Add tracing to all p* instructions.
+
 Tue Feb 24 02:47:33 1998  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * interp.c (sim_store_register, sim_fetch_register): Pull swifty