Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: src/a64/simulator-a64.cc

Issue 146833011: A64: Don't use a 'debug' instruction to implement the 'trace_sim' option. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/a64/code-stubs-a64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/a64/code-stubs-a64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698