Commit 6903ecbf authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: Use portable Printf formats.

BUG=

Review URL: https://codereview.chromium.org/1895843002

Cr-Commit-Position: refs/heads/master@{#35591}
parent 10413402
...@@ -586,7 +586,7 @@ void MipsDebugger::Debug() { ...@@ -586,7 +586,7 @@ void MipsDebugger::Debug() {
} }
while (cur < end) { while (cur < end) {
PrintF(" 0x%08x: 0x%08x %10d", PrintF(" 0x%08" PRIxPTR ": 0x%08x %10d",
reinterpret_cast<intptr_t>(cur), *cur, *cur); reinterpret_cast<intptr_t>(cur), *cur, *cur);
HeapObject* obj = reinterpret_cast<HeapObject*>(*cur); HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
int value = *cur; int value = *cur;
...@@ -649,8 +649,8 @@ void MipsDebugger::Debug() { ...@@ -649,8 +649,8 @@ void MipsDebugger::Debug() {
while (cur < end) { while (cur < end) {
dasm.InstructionDecode(buffer, cur); dasm.InstructionDecode(buffer, cur);
PrintF(" 0x%08x %s\n", PrintF(" 0x%08" PRIxPTR " %s\n", reinterpret_cast<intptr_t>(cur),
reinterpret_cast<intptr_t>(cur), buffer.start()); buffer.start());
cur += Instruction::kInstrSize; cur += Instruction::kInstrSize;
} }
} else if (strcmp(cmd, "gdb") == 0) { } else if (strcmp(cmd, "gdb") == 0) {
...@@ -771,8 +771,8 @@ void MipsDebugger::Debug() { ...@@ -771,8 +771,8 @@ void MipsDebugger::Debug() {
while (cur < end) { while (cur < end) {
dasm.InstructionDecode(buffer, cur); dasm.InstructionDecode(buffer, cur);
PrintF(" 0x%08x %s\n", PrintF(" 0x%08" PRIxPTR " %s\n", reinterpret_cast<intptr_t>(cur),
reinterpret_cast<intptr_t>(cur), buffer.start()); buffer.start());
cur += Instruction::kInstrSize; cur += Instruction::kInstrSize;
} }
} else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) { } else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
...@@ -1786,8 +1786,8 @@ void Simulator::TraceMemWr(int32_t addr, int32_t value, TraceType t) { ...@@ -1786,8 +1786,8 @@ void Simulator::TraceMemWr(int32_t addr, int32_t value, TraceType t) {
int Simulator::ReadW(int32_t addr, Instruction* instr) { int Simulator::ReadW(int32_t addr, Instruction* instr) {
if (addr >=0 && addr < 0x400) { if (addr >=0 && addr < 0x400) {
// This has to be a NULL-dereference, drop into debugger. // This has to be a NULL-dereference, drop into debugger.
PrintF("Memory read from bad address: 0x%08x, pc=0x%08x\n", PrintF("Memory read from bad address: 0x%08x, pc=0x%08" PRIxPTR "\n", addr,
addr, reinterpret_cast<intptr_t>(instr)); reinterpret_cast<intptr_t>(instr));
MipsDebugger dbg(this); MipsDebugger dbg(this);
dbg.Debug(); dbg.Debug();
} }
...@@ -1808,8 +1808,8 @@ int Simulator::ReadW(int32_t addr, Instruction* instr) { ...@@ -1808,8 +1808,8 @@ int Simulator::ReadW(int32_t addr, Instruction* instr) {
void Simulator::WriteW(int32_t addr, int value, Instruction* instr) { void Simulator::WriteW(int32_t addr, int value, Instruction* instr) {
if (addr >= 0 && addr < 0x400) { if (addr >= 0 && addr < 0x400) {
// This has to be a NULL-dereference, drop into debugger. // This has to be a NULL-dereference, drop into debugger.
PrintF("Memory write to bad address: 0x%08x, pc=0x%08x\n", PrintF("Memory write to bad address: 0x%08x, pc=0x%08" PRIxPTR "\n", addr,
addr, reinterpret_cast<intptr_t>(instr)); reinterpret_cast<intptr_t>(instr));
MipsDebugger dbg(this); MipsDebugger dbg(this);
dbg.Debug(); dbg.Debug();
} }
...@@ -1953,7 +1953,7 @@ uintptr_t Simulator::StackLimit(uintptr_t c_limit) const { ...@@ -1953,7 +1953,7 @@ uintptr_t Simulator::StackLimit(uintptr_t c_limit) const {
// Unsupported instructions use Format to print an error and stop execution. // Unsupported instructions use Format to print an error and stop execution.
void Simulator::Format(Instruction* instr, const char* format) { void Simulator::Format(Instruction* instr, const char* format) {
PrintF("Simulator found unsupported instruction:\n 0x%08x: %s\n", PrintF("Simulator found unsupported instruction:\n 0x%08" PRIxPTR ": %s\n",
reinterpret_cast<intptr_t>(instr), format); reinterpret_cast<intptr_t>(instr), format);
UNIMPLEMENTED_MIPS(); UNIMPLEMENTED_MIPS();
} }
...@@ -4413,8 +4413,9 @@ void Simulator::InstructionDecode(Instruction* instr) { ...@@ -4413,8 +4413,9 @@ void Simulator::InstructionDecode(Instruction* instr) {
UNSUPPORTED(); UNSUPPORTED();
} }
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
PrintF(" 0x%08x %-44s %s\n", reinterpret_cast<intptr_t>(instr), PrintF(" 0x%08" PRIxPTR " %-44s %s\n",
buffer.start(), trace_buf_.start()); reinterpret_cast<intptr_t>(instr), buffer.start(),
trace_buf_.start());
} }
if (!pc_modified_) { if (!pc_modified_) {
set_register(pc, reinterpret_cast<int32_t>(instr) + set_register(pc, reinterpret_cast<int32_t>(instr) +
......
...@@ -375,7 +375,8 @@ void Decoder::PrintXImm26(Instruction* instr) { ...@@ -375,7 +375,8 @@ void Decoder::PrintXImm26(Instruction* instr) {
uint64_t target = static_cast<uint64_t>(instr->Imm26Value()) uint64_t target = static_cast<uint64_t>(instr->Imm26Value())
<< kImmFieldShift; << kImmFieldShift;
target = (reinterpret_cast<uint64_t>(instr) & ~0xfffffff) | target; target = (reinterpret_cast<uint64_t>(instr) & ~0xfffffff) | target;
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%lx", target); out_buffer_pos_ +=
SNPrintF(out_buffer_ + out_buffer_pos_, "0x%" PRIx64, target);
} }
...@@ -801,16 +802,14 @@ int Decoder::DecodeBreakInstr(Instruction* instr) { ...@@ -801,16 +802,14 @@ int Decoder::DecodeBreakInstr(Instruction* instr) {
if (instr->Bits(25, 6) == static_cast<int>(kMaxStopCode)) { if (instr->Bits(25, 6) == static_cast<int>(kMaxStopCode)) {
// This is stop(msg). // This is stop(msg).
Format(instr, "break, code: 'code"); Format(instr, "break, code: 'code");
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, out_buffer_pos_ += SNPrintF(
"\n%p %08lx stop msg: %s", out_buffer_ + out_buffer_pos_,
static_cast<void*> "\n%p %08" PRIx64 " stop msg: %s",
(reinterpret_cast<int32_t*>(instr static_cast<void*>(
+ Instruction::kInstrSize)), reinterpret_cast<int32_t*>(instr + Instruction::kInstrSize)),
reinterpret_cast<uint64_t> reinterpret_cast<uint64_t>(
(*reinterpret_cast<char**>(instr *reinterpret_cast<char**>(instr + Instruction::kInstrSize)),
+ Instruction::kInstrSize)), *reinterpret_cast<char**>(instr + Instruction::kInstrSize));
*reinterpret_cast<char**>(instr
+ Instruction::kInstrSize));
// Size 3: the break_ instr, plus embedded 64-bit char pointer. // Size 3: the break_ instr, plus embedded 64-bit char pointer.
return 3 * Instruction::kInstrSize; return 3 * Instruction::kInstrSize;
} else { } else {
......
...@@ -268,33 +268,42 @@ void MipsDebugger::PrintAllRegs() { ...@@ -268,33 +268,42 @@ void MipsDebugger::PrintAllRegs() {
PrintF("\n"); PrintF("\n");
// at, v0, a0. // at, v0, a0.
PrintF("%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\n", PrintF("%3s: 0x%016" PRIx64 " %14" PRId64 "\t%3s: 0x%016" PRIx64 " %14" PRId64
"\t%3s: 0x%016" PRIx64 " %14" PRId64 "\n",
REG_INFO(1), REG_INFO(2), REG_INFO(4)); REG_INFO(1), REG_INFO(2), REG_INFO(4));
// v1, a1. // v1, a1.
PrintF("%34s\t%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\n", PrintF("%34s\t%3s: 0x%016" PRIx64 " %14" PRId64 " \t%3s: 0x%016" PRIx64
" %14" PRId64 " \n",
"", REG_INFO(3), REG_INFO(5)); "", REG_INFO(3), REG_INFO(5));
// a2. // a2.
PrintF("%34s\t%34s\t%3s: 0x%016lx %14ld\n", "", "", REG_INFO(6)); PrintF("%34s\t%34s\t%3s: 0x%016" PRIx64 " %14" PRId64 " \n", "", "",
REG_INFO(6));
// a3. // a3.
PrintF("%34s\t%34s\t%3s: 0x%016lx %14ld\n", "", "", REG_INFO(7)); PrintF("%34s\t%34s\t%3s: 0x%016" PRIx64 " %14" PRId64 " \n", "", "",
REG_INFO(7));
PrintF("\n"); PrintF("\n");
// a4-t3, s0-s7 // a4-t3, s0-s7
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
PrintF("%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\n", PrintF("%3s: 0x%016" PRIx64 " %14" PRId64 " \t%3s: 0x%016" PRIx64
REG_INFO(8+i), REG_INFO(16+i)); " %14" PRId64 " \n",
REG_INFO(8 + i), REG_INFO(16 + i));
} }
PrintF("\n"); PrintF("\n");
// t8, k0, LO. // t8, k0, LO.
PrintF("%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\n", PrintF("%3s: 0x%016" PRIx64 " %14" PRId64 " \t%3s: 0x%016" PRIx64
" %14" PRId64 " \t%3s: 0x%016" PRIx64 " %14" PRId64 " \n",
REG_INFO(24), REG_INFO(26), REG_INFO(32)); REG_INFO(24), REG_INFO(26), REG_INFO(32));
// t9, k1, HI. // t9, k1, HI.
PrintF("%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\n", PrintF("%3s: 0x%016" PRIx64 " %14" PRId64 " \t%3s: 0x%016" PRIx64
" %14" PRId64 " \t%3s: 0x%016" PRIx64 " %14" PRId64 " \n",
REG_INFO(25), REG_INFO(27), REG_INFO(33)); REG_INFO(25), REG_INFO(27), REG_INFO(33));
// sp, fp, gp. // sp, fp, gp.
PrintF("%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\n", PrintF("%3s: 0x%016" PRIx64 " %14" PRId64 " \t%3s: 0x%016" PRIx64
" %14" PRId64 " \t%3s: 0x%016" PRIx64 " %14" PRId64 " \n",
REG_INFO(29), REG_INFO(30), REG_INFO(28)); REG_INFO(29), REG_INFO(30), REG_INFO(28));
// pc. // pc.
PrintF("%3s: 0x%016lx %14ld\t%3s: 0x%016lx %14ld\n", PrintF("%3s: 0x%016" PRIx64 " %14" PRId64 " \t%3s: 0x%016" PRIx64
" %14" PRId64 " \n",
REG_INFO(31), REG_INFO(34)); REG_INFO(31), REG_INFO(34));
#undef REG_INFO #undef REG_INFO
...@@ -312,38 +321,38 @@ void MipsDebugger::PrintAllRegsIncludingFPU() { ...@@ -312,38 +321,38 @@ void MipsDebugger::PrintAllRegsIncludingFPU() {
PrintF("\n\n"); PrintF("\n\n");
// f0, f1, f2, ... f31. // f0, f1, f2, ... f31.
// TODO(plind): consider printing 2 columns for space efficiency. // TODO(plind): consider printing 2 columns for space efficiency.
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(0) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(0));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(1) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(1));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(2) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(2));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(3) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(3));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(4) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(4));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(5) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(5));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(6) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(6));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(7) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(7));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(8) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(8));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(9) ); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(9));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(10)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(10));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(11)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(11));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(12)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(12));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(13)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(13));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(14)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(14));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(15)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(15));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(16)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(16));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(17)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(17));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(18)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(18));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(19)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(19));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(20)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(20));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(21)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(21));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(22)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(22));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(23)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(23));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(24)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(24));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(25)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(25));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(26)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(26));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(27)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(27));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(28)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(28));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(29)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(29));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(30)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(30));
PrintF("%3s: 0x%016lx %16.4e\n", FPU_REG_INFO(31)); PrintF("%3s: 0x%016" PRIx64 " %16.4e\n", FPU_REG_INFO(31));
#undef REG_INFO #undef REG_INFO
#undef FPU_REG_INFO #undef FPU_REG_INFO
...@@ -382,7 +391,7 @@ void MipsDebugger::Debug() { ...@@ -382,7 +391,7 @@ void MipsDebugger::Debug() {
v8::internal::EmbeddedVector<char, 256> buffer; v8::internal::EmbeddedVector<char, 256> buffer;
dasm.InstructionDecode(buffer, dasm.InstructionDecode(buffer,
reinterpret_cast<byte*>(sim_->get_pc())); reinterpret_cast<byte*>(sim_->get_pc()));
PrintF(" 0x%016lx %s\n", sim_->get_pc(), buffer.start()); PrintF(" 0x%016" PRIx64 " %s\n", sim_->get_pc(), buffer.start());
last_pc = sim_->get_pc(); last_pc = sim_->get_pc();
} }
char* line = ReadLine("sim> "); char* line = ReadLine("sim> ");
...@@ -433,11 +442,12 @@ void MipsDebugger::Debug() { ...@@ -433,11 +442,12 @@ void MipsDebugger::Debug() {
if (regnum != kInvalidRegister) { if (regnum != kInvalidRegister) {
value = GetRegisterValue(regnum); value = GetRegisterValue(regnum);
PrintF("%s: 0x%08lx %ld \n", arg1, value, value); PrintF("%s: 0x%08" PRIx64 " %" PRId64 " \n", arg1, value,
value);
} else if (fpuregnum != kInvalidFPURegister) { } else if (fpuregnum != kInvalidFPURegister) {
value = GetFPURegisterValue(fpuregnum); value = GetFPURegisterValue(fpuregnum);
dvalue = GetFPURegisterValueDouble(fpuregnum); dvalue = GetFPURegisterValueDouble(fpuregnum);
PrintF("%3s: 0x%016lx %16.4e\n", PrintF("%3s: 0x%016" PRIx64 " %16.4e\n",
FPURegisters::Name(fpuregnum), value, dvalue); FPURegisters::Name(fpuregnum), value, dvalue);
} else { } else {
PrintF("%s unrecognized\n", arg1); PrintF("%s unrecognized\n", arg1);
...@@ -454,7 +464,7 @@ void MipsDebugger::Debug() { ...@@ -454,7 +464,7 @@ void MipsDebugger::Debug() {
value = GetFPURegisterValue(fpuregnum); value = GetFPURegisterValue(fpuregnum);
value &= 0xffffffffUL; value &= 0xffffffffUL;
fvalue = GetFPURegisterValueFloat(fpuregnum); fvalue = GetFPURegisterValueFloat(fpuregnum);
PrintF("%s: 0x%08lx %11.4e\n", arg1, value, fvalue); PrintF("%s: 0x%08" PRIx64 " %11.4e\n", arg1, value, fvalue);
} else { } else {
PrintF("%s unrecognized\n", arg1); PrintF("%s unrecognized\n", arg1);
} }
...@@ -513,7 +523,7 @@ void MipsDebugger::Debug() { ...@@ -513,7 +523,7 @@ void MipsDebugger::Debug() {
end = cur + words; end = cur + words;
while (cur < end) { while (cur < end) {
PrintF(" 0x%012lx: 0x%016lx %14ld", PrintF(" 0x%012" PRIxPTR " : 0x%016" PRIx64 " %14" PRId64 " ",
reinterpret_cast<intptr_t>(cur), *cur, *cur); reinterpret_cast<intptr_t>(cur), *cur, *cur);
HeapObject* obj = reinterpret_cast<HeapObject*>(*cur); HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
int64_t value = *cur; int64_t value = *cur;
...@@ -576,8 +586,8 @@ void MipsDebugger::Debug() { ...@@ -576,8 +586,8 @@ void MipsDebugger::Debug() {
while (cur < end) { while (cur < end) {
dasm.InstructionDecode(buffer, cur); dasm.InstructionDecode(buffer, cur);
PrintF(" 0x%08lx %s\n", PrintF(" 0x%08" PRIxPTR " %s\n", reinterpret_cast<intptr_t>(cur),
reinterpret_cast<intptr_t>(cur), buffer.start()); buffer.start());
cur += Instruction::kInstrSize; cur += Instruction::kInstrSize;
} }
} else if (strcmp(cmd, "gdb") == 0) { } else if (strcmp(cmd, "gdb") == 0) {
...@@ -698,8 +708,8 @@ void MipsDebugger::Debug() { ...@@ -698,8 +708,8 @@ void MipsDebugger::Debug() {
while (cur < end) { while (cur < end) {
dasm.InstructionDecode(buffer, cur); dasm.InstructionDecode(buffer, cur);
PrintF(" 0x%08lx %s\n", PrintF(" 0x%08" PRIxPTR " %s\n", reinterpret_cast<intptr_t>(cur),
reinterpret_cast<intptr_t>(cur), buffer.start()); buffer.start());
cur += Instruction::kInstrSize; cur += Instruction::kInstrSize;
} }
} else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) { } else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
...@@ -1683,7 +1693,7 @@ void Simulator::DieOrDebug() { ...@@ -1683,7 +1693,7 @@ void Simulator::DieOrDebug() {
void Simulator::TraceRegWr(int64_t value) { void Simulator::TraceRegWr(int64_t value) {
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
SNPrintF(trace_buf_, "%016lx", value); SNPrintF(trace_buf_, "%016" PRIx64 " ", value);
} }
} }
...@@ -1691,8 +1701,9 @@ void Simulator::TraceRegWr(int64_t value) { ...@@ -1691,8 +1701,9 @@ void Simulator::TraceRegWr(int64_t value) {
// TODO(plind): consider making icount_ printing a flag option. // TODO(plind): consider making icount_ printing a flag option.
void Simulator::TraceMemRd(int64_t addr, int64_t value) { void Simulator::TraceMemRd(int64_t addr, int64_t value) {
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
SNPrintF(trace_buf_, "%016lx <-- [%016lx] (%ld)", SNPrintF(trace_buf_,
value, addr, icount_); "%016" PRIx64 " <-- [%016" PRIx64 " ] (%" PRId64 " )", value,
addr, icount_);
} }
} }
...@@ -1701,19 +1712,20 @@ void Simulator::TraceMemWr(int64_t addr, int64_t value, TraceType t) { ...@@ -1701,19 +1712,20 @@ void Simulator::TraceMemWr(int64_t addr, int64_t value, TraceType t) {
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
switch (t) { switch (t) {
case BYTE: case BYTE:
SNPrintF(trace_buf_, " %02x --> [%016lx]", SNPrintF(trace_buf_, " %02x --> [%016" PRIx64 " ]",
static_cast<int8_t>(value), addr); static_cast<int8_t>(value), addr);
break; break;
case HALF: case HALF:
SNPrintF(trace_buf_, " %04x --> [%016lx]", SNPrintF(trace_buf_, " %04x --> [%016" PRIx64 " ]",
static_cast<int16_t>(value), addr); static_cast<int16_t>(value), addr);
break; break;
case WORD: case WORD:
SNPrintF(trace_buf_, " %08x --> [%016lx]", SNPrintF(trace_buf_, " %08x --> [%016" PRIx64 " ]",
static_cast<int32_t>(value), addr); static_cast<int32_t>(value), addr);
break; break;
case DWORD: case DWORD:
SNPrintF(trace_buf_, "%016lx --> [%016lx] (%ld)", SNPrintF(trace_buf_,
"%016" PRIx64 " --> [%016" PRIx64 " ] (%" PRId64 " )",
value, addr, icount_); value, addr, icount_);
break; break;
} }
...@@ -1726,7 +1738,8 @@ void Simulator::TraceMemWr(int64_t addr, int64_t value, TraceType t) { ...@@ -1726,7 +1738,8 @@ void Simulator::TraceMemWr(int64_t addr, int64_t value, TraceType t) {
int32_t Simulator::ReadW(int64_t addr, Instruction* instr) { int32_t Simulator::ReadW(int64_t addr, Instruction* instr) {
if (addr >=0 && addr < 0x400) { if (addr >=0 && addr < 0x400) {
// This has to be a NULL-dereference, drop into debugger. // This has to be a NULL-dereference, drop into debugger.
PrintF("Memory read from bad address: 0x%08lx, pc=0x%08lx\n", PrintF("Memory read from bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
" \n",
addr, reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1735,8 +1748,7 @@ int32_t Simulator::ReadW(int64_t addr, Instruction* instr) { ...@@ -1735,8 +1748,7 @@ int32_t Simulator::ReadW(int64_t addr, Instruction* instr) {
TraceMemRd(addr, static_cast<int64_t>(*ptr)); TraceMemRd(addr, static_cast<int64_t>(*ptr));
return *ptr; return *ptr;
} }
PrintF("Unaligned read at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned read at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
addr,
reinterpret_cast<intptr_t>(instr)); reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
return 0; return 0;
...@@ -1746,7 +1758,8 @@ int32_t Simulator::ReadW(int64_t addr, Instruction* instr) { ...@@ -1746,7 +1758,8 @@ int32_t Simulator::ReadW(int64_t addr, Instruction* instr) {
uint32_t Simulator::ReadWU(int64_t addr, Instruction* instr) { uint32_t Simulator::ReadWU(int64_t addr, Instruction* instr) {
if (addr >=0 && addr < 0x400) { if (addr >=0 && addr < 0x400) {
// This has to be a NULL-dereference, drop into debugger. // This has to be a NULL-dereference, drop into debugger.
PrintF("Memory read from bad address: 0x%08lx, pc=0x%08lx\n", PrintF("Memory read from bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
" \n",
addr, reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1755,8 +1768,7 @@ uint32_t Simulator::ReadWU(int64_t addr, Instruction* instr) { ...@@ -1755,8 +1768,7 @@ uint32_t Simulator::ReadWU(int64_t addr, Instruction* instr) {
TraceMemRd(addr, static_cast<int64_t>(*ptr)); TraceMemRd(addr, static_cast<int64_t>(*ptr));
return *ptr; return *ptr;
} }
PrintF("Unaligned read at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned read at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
addr,
reinterpret_cast<intptr_t>(instr)); reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
return 0; return 0;
...@@ -1766,7 +1778,8 @@ uint32_t Simulator::ReadWU(int64_t addr, Instruction* instr) { ...@@ -1766,7 +1778,8 @@ uint32_t Simulator::ReadWU(int64_t addr, Instruction* instr) {
void Simulator::WriteW(int64_t addr, int32_t value, Instruction* instr) { void Simulator::WriteW(int64_t addr, int32_t value, Instruction* instr) {
if (addr >= 0 && addr < 0x400) { if (addr >= 0 && addr < 0x400) {
// This has to be a NULL-dereference, drop into debugger. // This has to be a NULL-dereference, drop into debugger.
PrintF("Memory write to bad address: 0x%08lx, pc=0x%08lx\n", PrintF("Memory write to bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
" \n",
addr, reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1776,8 +1789,7 @@ void Simulator::WriteW(int64_t addr, int32_t value, Instruction* instr) { ...@@ -1776,8 +1789,7 @@ void Simulator::WriteW(int64_t addr, int32_t value, Instruction* instr) {
*ptr = value; *ptr = value;
return; return;
} }
PrintF("Unaligned write at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned write at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
addr,
reinterpret_cast<intptr_t>(instr)); reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1786,7 +1798,8 @@ void Simulator::WriteW(int64_t addr, int32_t value, Instruction* instr) { ...@@ -1786,7 +1798,8 @@ void Simulator::WriteW(int64_t addr, int32_t value, Instruction* instr) {
int64_t Simulator::Read2W(int64_t addr, Instruction* instr) { int64_t Simulator::Read2W(int64_t addr, Instruction* instr) {
if (addr >=0 && addr < 0x400) { if (addr >=0 && addr < 0x400) {
// This has to be a NULL-dereference, drop into debugger. // This has to be a NULL-dereference, drop into debugger.
PrintF("Memory read from bad address: 0x%08lx, pc=0x%08lx\n", PrintF("Memory read from bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
" \n",
addr, reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1795,8 +1808,7 @@ int64_t Simulator::Read2W(int64_t addr, Instruction* instr) { ...@@ -1795,8 +1808,7 @@ int64_t Simulator::Read2W(int64_t addr, Instruction* instr) {
TraceMemRd(addr, *ptr); TraceMemRd(addr, *ptr);
return *ptr; return *ptr;
} }
PrintF("Unaligned read at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned read at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
addr,
reinterpret_cast<intptr_t>(instr)); reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
return 0; return 0;
...@@ -1806,7 +1818,8 @@ int64_t Simulator::Read2W(int64_t addr, Instruction* instr) { ...@@ -1806,7 +1818,8 @@ int64_t Simulator::Read2W(int64_t addr, Instruction* instr) {
void Simulator::Write2W(int64_t addr, int64_t value, Instruction* instr) { void Simulator::Write2W(int64_t addr, int64_t value, Instruction* instr) {
if (addr >= 0 && addr < 0x400) { if (addr >= 0 && addr < 0x400) {
// This has to be a NULL-dereference, drop into debugger. // This has to be a NULL-dereference, drop into debugger.
PrintF("Memory write to bad address: 0x%08lx, pc=0x%08lx\n", PrintF("Memory write to bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
"\n",
addr, reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1816,8 +1829,7 @@ void Simulator::Write2W(int64_t addr, int64_t value, Instruction* instr) { ...@@ -1816,8 +1829,7 @@ void Simulator::Write2W(int64_t addr, int64_t value, Instruction* instr) {
*ptr = value; *ptr = value;
return; return;
} }
PrintF("Unaligned write at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned write at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
addr,
reinterpret_cast<intptr_t>(instr)); reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1828,9 +1840,8 @@ double Simulator::ReadD(int64_t addr, Instruction* instr) { ...@@ -1828,9 +1840,8 @@ double Simulator::ReadD(int64_t addr, Instruction* instr) {
double* ptr = reinterpret_cast<double*>(addr); double* ptr = reinterpret_cast<double*>(addr);
return *ptr; return *ptr;
} }
PrintF("Unaligned (double) read at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned (double) read at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n",
addr, addr, reinterpret_cast<intptr_t>(instr));
reinterpret_cast<intptr_t>(instr));
base::OS::Abort(); base::OS::Abort();
return 0; return 0;
} }
...@@ -1842,9 +1853,9 @@ void Simulator::WriteD(int64_t addr, double value, Instruction* instr) { ...@@ -1842,9 +1853,9 @@ void Simulator::WriteD(int64_t addr, double value, Instruction* instr) {
*ptr = value; *ptr = value;
return; return;
} }
PrintF("Unaligned (double) write at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned (double) write at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR
addr, "\n",
reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1855,9 +1866,9 @@ uint16_t Simulator::ReadHU(int64_t addr, Instruction* instr) { ...@@ -1855,9 +1866,9 @@ uint16_t Simulator::ReadHU(int64_t addr, Instruction* instr) {
TraceMemRd(addr, static_cast<int64_t>(*ptr)); TraceMemRd(addr, static_cast<int64_t>(*ptr));
return *ptr; return *ptr;
} }
PrintF("Unaligned unsigned halfword read at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned unsigned halfword read at 0x%08" PRIx64
addr, " , pc=0x%08" V8PRIxPTR "\n",
reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
return 0; return 0;
} }
...@@ -1869,9 +1880,9 @@ int16_t Simulator::ReadH(int64_t addr, Instruction* instr) { ...@@ -1869,9 +1880,9 @@ int16_t Simulator::ReadH(int64_t addr, Instruction* instr) {
TraceMemRd(addr, static_cast<int64_t>(*ptr)); TraceMemRd(addr, static_cast<int64_t>(*ptr));
return *ptr; return *ptr;
} }
PrintF("Unaligned signed halfword read at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned signed halfword read at 0x%08" PRIx64
addr, " , pc=0x%08" V8PRIxPTR "\n",
reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
return 0; return 0;
} }
...@@ -1884,10 +1895,9 @@ void Simulator::WriteH(int64_t addr, uint16_t value, Instruction* instr) { ...@@ -1884,10 +1895,9 @@ void Simulator::WriteH(int64_t addr, uint16_t value, Instruction* instr) {
*ptr = value; *ptr = value;
return; return;
} }
PrintF( PrintF("Unaligned unsigned halfword write at 0x%08" PRIx64
"Unaligned unsigned halfword write at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", " , pc=0x%08" V8PRIxPTR "\n",
addr, addr, reinterpret_cast<intptr_t>(instr));
reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1899,9 +1909,9 @@ void Simulator::WriteH(int64_t addr, int16_t value, Instruction* instr) { ...@@ -1899,9 +1909,9 @@ void Simulator::WriteH(int64_t addr, int16_t value, Instruction* instr) {
*ptr = value; *ptr = value;
return; return;
} }
PrintF("Unaligned halfword write at 0x%08lx, pc=0x%08" V8PRIxPTR "\n", PrintF("Unaligned halfword write at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR
addr, "\n",
reinterpret_cast<intptr_t>(instr)); addr, reinterpret_cast<intptr_t>(instr));
DieOrDebug(); DieOrDebug();
} }
...@@ -1950,7 +1960,7 @@ uintptr_t Simulator::StackLimit(uintptr_t c_limit) const { ...@@ -1950,7 +1960,7 @@ uintptr_t Simulator::StackLimit(uintptr_t c_limit) const {
// Unsupported instructions use Format to print an error and stop execution. // Unsupported instructions use Format to print an error and stop execution.
void Simulator::Format(Instruction* instr, const char* format) { void Simulator::Format(Instruction* instr, const char* format) {
PrintF("Simulator found unsupported instruction:\n 0x%08lx: %s\n", PrintF("Simulator found unsupported instruction:\n 0x%08" PRIxPTR " : %s\n",
reinterpret_cast<intptr_t>(instr), format); reinterpret_cast<intptr_t>(instr), format);
UNIMPLEMENTED_MIPS(); UNIMPLEMENTED_MIPS();
} }
...@@ -2133,8 +2143,8 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { ...@@ -2133,8 +2143,8 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
} }
} else if (redirection->type() == ExternalReference::DIRECT_API_CALL) { } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
PrintF("Call to host function at %p args %08lx\n", PrintF("Call to host function at %p args %08" PRIx64 " \n",
reinterpret_cast<void*>(external), arg0); reinterpret_cast<void*>(external), arg0);
} }
SimulatorRuntimeDirectApiCall target = SimulatorRuntimeDirectApiCall target =
reinterpret_cast<SimulatorRuntimeDirectApiCall>(external); reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
...@@ -2142,8 +2152,9 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { ...@@ -2142,8 +2152,9 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
} else if ( } else if (
redirection->type() == ExternalReference::PROFILING_API_CALL) { redirection->type() == ExternalReference::PROFILING_API_CALL) {
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
PrintF("Call to host function at %p args %08lx %08lx\n", PrintF("Call to host function at %p args %08" PRIx64 " %08" PRIx64
reinterpret_cast<void*>(external), arg0, arg1); " \n",
reinterpret_cast<void*>(external), arg0, arg1);
} }
SimulatorRuntimeProfilingApiCall target = SimulatorRuntimeProfilingApiCall target =
reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external); reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external);
...@@ -2151,8 +2162,9 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { ...@@ -2151,8 +2162,9 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
} else if ( } else if (
redirection->type() == ExternalReference::DIRECT_GETTER_CALL) { redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
PrintF("Call to host function at %p args %08lx %08lx\n", PrintF("Call to host function at %p args %08" PRIx64 " %08" PRIx64
reinterpret_cast<void*>(external), arg0, arg1); " \n",
reinterpret_cast<void*>(external), arg0, arg1);
} }
SimulatorRuntimeDirectGetterCall target = SimulatorRuntimeDirectGetterCall target =
reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external); reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
...@@ -2160,8 +2172,9 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { ...@@ -2160,8 +2172,9 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
} else if ( } else if (
redirection->type() == ExternalReference::PROFILING_GETTER_CALL) { redirection->type() == ExternalReference::PROFILING_GETTER_CALL) {
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
PrintF("Call to host function at %p args %08lx %08lx %08lx\n", PrintF("Call to host function at %p args %08" PRIx64 " %08" PRIx64
reinterpret_cast<void*>(external), arg0, arg1, arg2); " %08" PRIx64 " \n",
reinterpret_cast<void*>(external), arg0, arg1, arg2);
} }
SimulatorRuntimeProfilingGetterCall target = SimulatorRuntimeProfilingGetterCall target =
reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(external); reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(external);
...@@ -2195,14 +2208,9 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { ...@@ -2195,14 +2208,9 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
PrintF( PrintF(
"Call to host function at %p " "Call to host function at %p "
"args %08lx, %08lx, %08lx, %08lx, %08lx, %08lx\n", "args %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64
FUNCTION_ADDR(target), " , %08" PRIx64 " , %08" PRIx64 " \n",
arg0, FUNCTION_ADDR(target), arg0, arg1, arg2, arg3, arg4, arg5);
arg1,
arg2,
arg3,
arg4,
arg5);
} }
// int64_t result = target(arg0, arg1, arg2, arg3, arg4, arg5); // int64_t result = target(arg0, arg1, arg2, arg3, arg4, arg5);
// set_register(v0, static_cast<int32_t>(result)); // set_register(v0, static_cast<int32_t>(result));
...@@ -2212,7 +2220,8 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { ...@@ -2212,7 +2220,8 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
set_register(v1, (int64_t)(result.y)); set_register(v1, (int64_t)(result.y));
} }
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
PrintF("Returned %08lx : %08lx\n", get_register(v1), get_register(v0)); PrintF("Returned %08" PRIx64 " : %08" PRIx64 " \n", get_register(v1),
get_register(v0));
} }
set_register(ra, saved_ra); set_register(ra, saved_ra);
set_pc(get_register(ra)); set_pc(get_register(ra));
...@@ -2241,7 +2250,8 @@ bool Simulator::IsWatchpoint(uint64_t code) { ...@@ -2241,7 +2250,8 @@ bool Simulator::IsWatchpoint(uint64_t code) {
void Simulator::PrintWatchpoint(uint64_t code) { void Simulator::PrintWatchpoint(uint64_t code) {
MipsDebugger dbg(this); MipsDebugger dbg(this);
++break_count_; ++break_count_;
PrintF("\n---- break %ld marker: %3d (instr count: %8ld) ----------" PrintF("\n---- break %" PRId64 " marker: %3d (instr count: %8" PRId64
" ) ----------"
"----------------------------------", "----------------------------------",
code, break_count_, icount_); code, break_count_, icount_);
dbg.PrintAllRegs(); // Print registers and continue running. dbg.PrintAllRegs(); // Print registers and continue running.
...@@ -2291,8 +2301,10 @@ void Simulator::DisableStop(uint64_t code) { ...@@ -2291,8 +2301,10 @@ void Simulator::DisableStop(uint64_t code) {
void Simulator::IncreaseStopCounter(uint64_t code) { void Simulator::IncreaseStopCounter(uint64_t code) {
DCHECK(code <= kMaxStopCode); DCHECK(code <= kMaxStopCode);
if ((watched_stops_[code].count & ~(1 << 31)) == 0x7fffffff) { if ((watched_stops_[code].count & ~(1 << 31)) == 0x7fffffff) {
PrintF("Stop counter for code %ld has overflowed.\n" PrintF("Stop counter for code %" PRId64
"Enabling this code and reseting the counter to 0.\n", code); " has overflowed.\n"
"Enabling this code and reseting the counter to 0.\n",
code);
watched_stops_[code].count = 0; watched_stops_[code].count = 0;
EnableStop(code); EnableStop(code);
} else { } else {
...@@ -2315,11 +2327,11 @@ void Simulator::PrintStopInfo(uint64_t code) { ...@@ -2315,11 +2327,11 @@ void Simulator::PrintStopInfo(uint64_t code) {
// Don't print the state of unused breakpoints. // Don't print the state of unused breakpoints.
if (count != 0) { if (count != 0) {
if (watched_stops_[code].desc) { if (watched_stops_[code].desc) {
PrintF("stop %ld - 0x%lx: \t%s, \tcounter = %i, \t%s\n", PrintF("stop %" PRId64 " - 0x%" PRIx64 " : \t%s, \tcounter = %i, \t%s\n",
code, code, state, count, watched_stops_[code].desc); code, code, state, count, watched_stops_[code].desc);
} else { } else {
PrintF("stop %ld - 0x%lx: \t%s, \tcounter = %i\n", PrintF("stop %" PRId64 " - 0x%" PRIx64 " : \t%s, \tcounter = %i\n", code,
code, code, state, count); code, state, count);
} }
} }
} }
...@@ -4672,8 +4684,9 @@ void Simulator::InstructionDecode(Instruction* instr) { ...@@ -4672,8 +4684,9 @@ void Simulator::InstructionDecode(Instruction* instr) {
} }
if (::v8::internal::FLAG_trace_sim) { if (::v8::internal::FLAG_trace_sim) {
PrintF(" 0x%08lx %-44s %s\n", reinterpret_cast<intptr_t>(instr), PrintF(" 0x%08" PRIxPTR " %-44s %s\n",
buffer.start(), trace_buf_.start()); reinterpret_cast<intptr_t>(instr), buffer.start(),
trace_buf_.start());
} }
if (!pc_modified_) { if (!pc_modified_) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment