Reviewers: m.m.capewell,
Description:
A64: Don't use a 'debug' instruction to implement the 'trace_sim' option.
Instead let the 'trace_sim' flag override normal tracing settings.
Please review this at https://codereview.chromium.org/146833011/
SVN Base: https://v8.googlecode.com/svn/branches/experimental/a64
Affected files (+9, -13 lines):
M src/a64/code-stubs-a64.cc
M src/a64/simulator-a64.cc
Index: src/a64/code-stubs-a64.cc
diff --git a/src/a64/code-stubs-a64.cc b/src/a64/code-stubs-a64.cc
index
8a62bf3e97ca3b48f26706c3a99e202c6ad9da94..d444fa4700d23767c21482b7cd053a3e16bd5e69
100644
--- a/src/a64/code-stubs-a64.cc
+++ b/src/a64/code-stubs-a64.cc
@@ -2909,12 +2909,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm,
bool is_construct) {
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();
Index: src/a64/simulator-a64.cc
diff --git a/src/a64/simulator-a64.cc b/src/a64/simulator-a64.cc
index
fb2232b3f3d76578b466d0ddea1de682841754cb..98bfc7f849ba5529424ce887b04c98202f00f263
100644
--- a/src/a64/simulator-a64.cc
+++ b/src/a64/simulator-a64.cc
@@ -372,6 +372,11 @@ Simulator::Simulator(Decoder* decoder, Isolate*
isolate, FILE* stream)
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 @@ void Simulator::VisitException(Instruction* instr) {
// 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.