Revision: 18857
Author:   [email protected]
Date:     Mon Jan 27 15:26:47 2014 UTC
Log: A64: Don't use a 'debug' instruction to implement the 'trace_sim' option.

Instead let the 'trace_sim' flag override normal tracing settings.

[email protected]

Review URL: https://codereview.chromium.org/146833011
http://code.google.com/p/v8/source/detail?r=18857

Modified:
 /branches/experimental/a64/src/a64/code-stubs-a64.cc
 /branches/experimental/a64/src/a64/simulator-a64.cc

=======================================
--- /branches/experimental/a64/src/a64/code-stubs-a64.cc Fri Jan 24 14:09:40 2014 UTC +++ /branches/experimental/a64/src/a64/code-stubs-a64.cc Mon Jan 27 15:26:47 2014 UTC
@@ -2909,12 +2909,6 @@
   ASSERT(jssp.Is(__ StackPointer()));
   Register code_entry = x0;

- // TODO(all): We shouldn't emit debug instructions unconditionally since they - // will not work outside the simulator. We need to rethink how these commands
-  // interact with --trace-sim. For now, though, this turns on instruction
-  // tracing _if_ --trace-sim is specified.
-  __ Debug("TRACE ENTRY", 0, TRACE_ENABLE | LOG_ALL);
-
// Enable instruction instrumentation. This only works on the simulator, and
   // will have no effect on the model or real hardware.
   __ EnableInstrumentation();
=======================================
--- /branches/experimental/a64/src/a64/simulator-a64.cc Fri Jan 24 15:19:36 2014 UTC +++ /branches/experimental/a64/src/a64/simulator-a64.cc Mon Jan 27 15:26:47 2014 UTC
@@ -372,6 +372,11 @@
   stream_ = stream;
   print_disasm_ = new PrintDisassembler(stream_);

+  if (FLAG_trace_sim) {
+    decoder_->InsertVisitorBefore(print_disasm_, this);
+    log_parameters_ = LOG_ALL;
+  }
+
// The debugger needs to disassemble code without the simulator executing an
   // instruction, so we create a dedicated decoder.
   disassembler_decoder_ = new Decoder();
@@ -3075,13 +3080,10 @@
         // Other options.
         switch (parameters & kDebuggerTracingDirectivesMask) {
           case TRACE_ENABLE:
-            // Only enable tracing if the trace_sim flag is set.
-            if (FLAG_trace_sim) {
-              set_log_parameters(log_parameters() | parameters);
-              if (parameters & LOG_SYS_REGS) { PrintSystemRegisters(); }
-              if (parameters & LOG_REGS) { PrintRegisters(); }
-              if (parameters & LOG_FP_REGS) { PrintFPRegisters(); }
-            }
+            set_log_parameters(log_parameters() | parameters);
+            if (parameters & LOG_SYS_REGS) { PrintSystemRegisters(); }
+            if (parameters & LOG_REGS) { PrintRegisters(); }
+            if (parameters & LOG_FP_REGS) { PrintFPRegisters(); }
             break;
           case TRACE_DISABLE:
             set_log_parameters(log_parameters() & ~parameters);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to