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

Unified Diff: runtime/vm/assembler_ia32.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 | « no previous file | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
===================================================================
--- runtime/vm/assembler_ia32.cc (revision 3123)
+++ runtime/vm/assembler_ia32.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.");
+
+
class DirectCallRelocation : public AssemblerFixup {
public:
void Process(const MemoryRegion& region, int position) {
@@ -1438,11 +1442,17 @@
void Assembler::Stop(const char* message) {
- // Emit the message address as immediate operand in the test rax instruction,
- // followed by the int3 instruction.
- // Execution can be resumed with the 'cont' command in gdb.
- testl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
- int3();
+ if (FLAG_print_stop_message) {
+ pushl(EAX); // Preserve EAX.
+ movl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
+ call(&StubCode::PrintStopMessageLabel()); // Passing message in EAX.
+ popl(EAX); // Restore EAX.
+ } else {
+ // Emit the message address as immediate operand in the test instruction.
+ testl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
+ }
+ // Emit the int3 instruction.
+ int3(); // Execution can be resumed with the 'cont' command in gdb.
}
« no previous file with comments | « no previous file | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698