| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 stack_size_ = (FLAG_sim_stack_size * KB) + (2 * stack_protection_size_); | 365 stack_size_ = (FLAG_sim_stack_size * KB) + (2 * stack_protection_size_); |
| 366 stack_ = new byte[stack_size_]; | 366 stack_ = new byte[stack_size_]; |
| 367 stack_limit_ = stack_ + stack_protection_size_; | 367 stack_limit_ = stack_ + stack_protection_size_; |
| 368 byte* tos = stack_ + stack_size_ - stack_protection_size_; | 368 byte* tos = stack_ + stack_size_ - stack_protection_size_; |
| 369 // The stack pointer must be 16 bytes aligned. | 369 // The stack pointer must be 16 bytes aligned. |
| 370 set_sp(reinterpret_cast<int64_t>(tos) & ~0xfUL); | 370 set_sp(reinterpret_cast<int64_t>(tos) & ~0xfUL); |
| 371 | 371 |
| 372 stream_ = stream; | 372 stream_ = stream; |
| 373 print_disasm_ = new PrintDisassembler(stream_); | 373 print_disasm_ = new PrintDisassembler(stream_); |
| 374 | 374 |
| 375 if (FLAG_trace_sim) { |
| 376 decoder_->InsertVisitorBefore(print_disasm_, this); |
| 377 log_parameters_ = LOG_ALL; |
| 378 } |
| 379 |
| 375 // The debugger needs to disassemble code without the simulator executing an | 380 // The debugger needs to disassemble code without the simulator executing an |
| 376 // instruction, so we create a dedicated decoder. | 381 // instruction, so we create a dedicated decoder. |
| 377 disassembler_decoder_ = new Decoder(); | 382 disassembler_decoder_ = new Decoder(); |
| 378 disassembler_decoder_->AppendVisitor(print_disasm_); | 383 disassembler_decoder_->AppendVisitor(print_disasm_); |
| 379 | 384 |
| 380 if (FLAG_log_instruction_stats) { | 385 if (FLAG_log_instruction_stats) { |
| 381 instrument_ = new Instrument(FLAG_log_instruction_file, | 386 instrument_ = new Instrument(FLAG_log_instruction_file, |
| 382 FLAG_log_instruction_period); | 387 FLAG_log_instruction_period); |
| 383 decoder_->AppendVisitor(instrument_); | 388 decoder_->AppendVisitor(instrument_); |
| 384 } | 389 } |
| (...skipping 2683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3068 PrintF("%sDebugger hit %d.%s\n", | 3073 PrintF("%sDebugger hit %d.%s\n", |
| 3069 clr_debug_number, | 3074 clr_debug_number, |
| 3070 code, | 3075 code, |
| 3071 clr_normal); | 3076 clr_normal); |
| 3072 } | 3077 } |
| 3073 } | 3078 } |
| 3074 | 3079 |
| 3075 // Other options. | 3080 // Other options. |
| 3076 switch (parameters & kDebuggerTracingDirectivesMask) { | 3081 switch (parameters & kDebuggerTracingDirectivesMask) { |
| 3077 case TRACE_ENABLE: | 3082 case TRACE_ENABLE: |
| 3078 // Only enable tracing if the trace_sim flag is set. | 3083 set_log_parameters(log_parameters() | parameters); |
| 3079 if (FLAG_trace_sim) { | 3084 if (parameters & LOG_SYS_REGS) { PrintSystemRegisters(); } |
| 3080 set_log_parameters(log_parameters() | parameters); | 3085 if (parameters & LOG_REGS) { PrintRegisters(); } |
| 3081 if (parameters & LOG_SYS_REGS) { PrintSystemRegisters(); } | 3086 if (parameters & LOG_FP_REGS) { PrintFPRegisters(); } |
| 3082 if (parameters & LOG_REGS) { PrintRegisters(); } | |
| 3083 if (parameters & LOG_FP_REGS) { PrintFPRegisters(); } | |
| 3084 } | |
| 3085 break; | 3087 break; |
| 3086 case TRACE_DISABLE: | 3088 case TRACE_DISABLE: |
| 3087 set_log_parameters(log_parameters() & ~parameters); | 3089 set_log_parameters(log_parameters() & ~parameters); |
| 3088 break; | 3090 break; |
| 3089 case TRACE_OVERRIDE: | 3091 case TRACE_OVERRIDE: |
| 3090 set_log_parameters(parameters); | 3092 set_log_parameters(parameters); |
| 3091 break; | 3093 break; |
| 3092 default: | 3094 default: |
| 3093 // We don't support a one-shot LOG_DISASM. | 3095 // We don't support a one-shot LOG_DISASM. |
| 3094 ASSERT((parameters & LOG_DISASM) == 0); | 3096 ASSERT((parameters & LOG_DISASM) == 0); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3413 default: | 3415 default: |
| 3414 UNIMPLEMENTED(); | 3416 UNIMPLEMENTED(); |
| 3415 } | 3417 } |
| 3416 } | 3418 } |
| 3417 | 3419 |
| 3418 #endif // USE_SIMULATOR | 3420 #endif // USE_SIMULATOR |
| 3419 | 3421 |
| 3420 } } // namespace v8::internal | 3422 } } // namespace v8::internal |
| 3421 | 3423 |
| 3422 #endif // V8_TARGET_ARCH_A64 | 3424 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |