Chromium Code Reviews| Index: src/arm/simulator-arm.cc |
| diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc |
| index cedce6d4ba26d8d4f3560e47d0e01962d9c561d9..e27c3c3a3b24cfe1b48bf8d5f89e265e193097b4 100644 |
| --- a/src/arm/simulator-arm.cc |
| +++ b/src/arm/simulator-arm.cc |
| @@ -316,16 +316,26 @@ void Debugger::Debug() { |
| } |
| for (int i = 0; i < kNumVFPDoubleRegisters; i++) { |
| dvalue = GetVFPDoubleRegisterValue(i); |
| - PrintF("%3s: %f\n", |
| - VFPRegisters::Name(i, true), dvalue); |
| + int32_t* as_word = reinterpret_cast<int32_t*>(&dvalue); |
| + PrintF("%3s: %f 0x%08x %08x\n", |
| + VFPRegisters::Name(i, true), |
| + dvalue, |
| + as_word[1], |
| + as_word[0]); |
| } |
| } else { |
| if (GetValue(arg1, &value)) { |
| PrintF("%s: 0x%08x %d \n", arg1, value, value); |
| } else if (GetVFPSingleValue(arg1, &svalue)) { |
| - PrintF("%s: %f \n", arg1, svalue); |
| + int32_t* as_word = reinterpret_cast<int32_t*>(&svalue); |
| + PrintF("%s: %f 0x%08x\n", arg1, svalue, *as_word); |
| } else if (GetVFPDoubleValue(arg1, &dvalue)) { |
| - PrintF("%s: %f \n", arg1, dvalue); |
| + int32_t* as_word = reinterpret_cast<int32_t*>(&dvalue); |
| + PrintF("%s: %f 0x%08x %08x\n", |
| + arg1, |
| + dvalue, |
| + as_word[1], |
| + as_word[0]); |
| } else { |
| PrintF("%s unrecognized\n", arg1); |
| } |
| @@ -380,11 +390,23 @@ void Debugger::Debug() { |
| end = cur + words; |
| while (cur < end) { |
| - PrintF(" 0x%08x: 0x%08x %10d\n", |
| + PrintF(" 0x%08x: 0x%08x %10d", |
| reinterpret_cast<intptr_t>(cur), *cur, *cur); |
| + HeapObject* obj = reinterpret_cast<HeapObject*>(*cur); |
| + int value = *cur; |
| + if (Heap::Contains(obj) || ((value & 1) == 0)) { |
| + PrintF(" ("); |
| + if ((value & 1) == 0) { |
| + PrintF("smi %d", value / 2); |
| + } else { |
| + obj->ShortPrint(); |
| + } |
| + PrintF(")"); |
| + } |
| + PrintF("\n"); |
| cur++; |
| } |
| - } else if (strcmp(cmd, "disasm") == 0) { |
| + } else if (strcmp(cmd, "disasm") == 0 || strcmp(cmd, "da")) { |
|
Søren Thygesen Gjesse
2011/03/16 22:28:42
Maybe di instead of da?
Karl Klose
2011/03/17 10:10:07
Done.
|
| disasm::NameConverter converter; |
| disasm::Disassembler dasm(converter); |
| // use a reasonably large buffer |
| @@ -398,11 +420,23 @@ void Debugger::Debug() { |
| cur = reinterpret_cast<byte*>(sim_->get_pc()); |
| end = cur + (10 * Instruction::kInstrSize); |
| } else if (argc == 2) { |
| - int32_t value; |
| - if (GetValue(arg1, &value)) { |
| - cur = reinterpret_cast<byte*>(sim_->get_pc()); |
| - // Disassemble <arg1> instructions. |
| - end = cur + (value * Instruction::kInstrSize); |
| + int regnum = Registers::Number(arg1); |
| + if (regnum != kNoRegister || strncmp(arg1, "0x", 2) == 0) { |
| + // The argument is an address or a register name. |
| + int32_t value; |
| + if (GetValue(arg1, &value)) { |
| + cur = reinterpret_cast<byte*>(value); |
| + // Disassemble 10 instructions at <arg1>. |
| + end = cur + (10 * Instruction::kInstrSize); |
| + } |
| + } else { |
| + // The argument is the number of instructions. |
| + int32_t value; |
| + if (GetValue(arg1, &value)) { |
| + cur = reinterpret_cast<byte*>(sim_->get_pc()); |
| + // Disassemble <arg1> instructions. |
| + end = cur + (value * Instruction::kInstrSize); |
| + } |
| } |
| } else { |
| int32_t value1; |