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

Unified Diff: dart/runtime/vm/debugger_x64.cc

Issue 119673004: Version 1.1.0-dev.5.2 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 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 | « dart/runtime/vm/debugger_test.cc ('k') | dart/runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/vm/debugger_x64.cc
===================================================================
--- dart/runtime/vm/debugger_x64.cc (revision 31530)
+++ dart/runtime/vm/debugger_x64.cc (working copy)
@@ -32,42 +32,6 @@
*reinterpret_cast<uword*>(closure_addr));
}
-
-void CodeBreakpoint::PatchFunctionReturn() {
- uint8_t* code = reinterpret_cast<uint8_t*>(pc_ - 13);
- ASSERT((code[0] == 0x4c) && (code[1] == 0x8b) && (code[2] == 0x7d) &&
- (code[3] == 0xf0)); // movq r15,[rbp-0x10]
- ASSERT((code[4] == 0x48) && (code[5] == 0x89) &&
- (code[6] == 0xec)); // mov rsp, rbp
- ASSERT(code[7] == 0x5d); // pop rbp
- ASSERT(code[8] == 0xc3); // ret
- ASSERT((code[9] == 0x0F) && (code[10] == 0x1F) && (code[11] == 0x40) &&
- (code[12] == 0x00)); // nops
- // Smash code with call instruction and relative target address.
- uword stub_addr = StubCode::BreakpointReturnEntryPoint();
- code[0] = 0x49;
- code[1] = 0xbb;
- *reinterpret_cast<uword*>(&code[2]) = stub_addr;
- code[10] = 0x41;
- code[11] = 0xff;
- code[12] = 0xd3;
- CPU::FlushICache(pc_ - 13, 13);
-}
-
-
-void CodeBreakpoint::RestoreFunctionReturn() {
- uint8_t* code = reinterpret_cast<uint8_t*>(pc_ - 13);
- ASSERT((code[0] == 0x49) && (code[1] == 0xbb));
-
- MemoryRegion code_region(reinterpret_cast<void*>(pc_ - 13), 13);
- Assembler assembler;
-
- assembler.ReturnPatchable();
- assembler.FinalizeInstructions(code_region);
-
- CPU::FlushICache(pc_ - 13, 13);
-}
-
} // namespace dart
#endif // defined TARGET_ARCH_X64
« no previous file with comments | « dart/runtime/vm/debugger_test.cc ('k') | dart/runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698