Chromium Code Reviews| Index: runtime/vm/assembler_x64.cc |
| =================================================================== |
| --- runtime/vm/assembler_x64.cc (revision 3122) |
| +++ runtime/vm/assembler_x64.cc (working copy) |
| @@ -9,9 +9,13 @@ |
| #include "vm/heap.h" |
| #include "vm/memory_region.h" |
| #include "vm/runtime_entry.h" |
| +#include "vm/stub_code.h" |
| namespace dart { |
| +DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); |
| + |
| + |
| void Assembler::InitializeMemoryWithBreakpoints(uword data, int length) { |
| memset(reinterpret_cast<void*>(data), Instr::kBreakPointInstruction, length); |
| } |
| @@ -1302,10 +1306,18 @@ |
| void Assembler::Stop(const char* message) { |
| + int64_t message_address = reinterpret_cast<int64_t>(message); |
| + if (FLAG_print_stop_message) { |
| + pushq(TMP); // Preserve TMP register. |
| + pushq(RDI); // Preserve RDI register. |
| + movq(RDI, Immediate(message_address)); |
| + call(&StubCode::PrintStopMessageLabel()); |
| + popq(RDI); // Restore RDI register. |
| + popq(TMP); // Restore TMP register. |
| + } |
| // Emit the lower half and the higher half of the message address as immediate |
| // operands in the test rax instructions, followed by the int3 instruction. |
| // Execution can be resumed with the 'cont' command in gdb. |
| - int64_t message_address = reinterpret_cast<int64_t>(message); |
| testl(RAX, Immediate(Utils::Low32Bits(message_address))); |
|
Ivan Posva
2012/01/10 00:18:17
How about wrapping the testl instructions into the
regis
2012/01/10 00:32:37
Done.
|
| testl(RAX, Immediate(Utils::High32Bits(message_address))); |
| int3(); |