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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 9128002: Print stop message. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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 | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.cc
===================================================================
--- runtime/vm/assembler_x64.cc (revision 3123)
+++ 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,13 +1306,22 @@
void Assembler::Stop(const char* message) {
- // 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)));
- testl(RAX, Immediate(Utils::High32Bits(message_address)));
- int3();
+ 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.
+ } else {
+ // Emit the lower half and the higher half of the message address as
+ // immediate operands in the test rax instructions.
+ testl(RAX, Immediate(Utils::Low32Bits(message_address)));
+ testl(RAX, Immediate(Utils::High32Bits(message_address)));
+ }
+ // Emit the int3 instruction.
+ int3(); // Execution can be resumed with the 'cont' command in gdb.
}
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698