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

Side by Side Diff: runtime/vm/debugger_ia32.cc

Issue 13983016: Support debugger API on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/debugger_arm.cc ('k') | runtime/vm/debugger_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 9
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 28 matching lines...) Expand all
39 uint8_t* code = reinterpret_cast<uint8_t*>(pc_ - 5); 39 uint8_t* code = reinterpret_cast<uint8_t*>(pc_ - 5);
40 ASSERT((code[0] == 0x89) && (code[1] == 0xEC)); // mov esp,ebp 40 ASSERT((code[0] == 0x89) && (code[1] == 0xEC)); // mov esp,ebp
41 ASSERT(code[2] == 0x5D); // pop ebp 41 ASSERT(code[2] == 0x5D); // pop ebp
42 ASSERT(code[3] == 0xC3); // ret 42 ASSERT(code[3] == 0xC3); // ret
43 ASSERT(code[4] == 0x90); // nop 43 ASSERT(code[4] == 0x90); // nop
44 44
45 // Smash code with call instruction and relative target address. 45 // Smash code with call instruction and relative target address.
46 uword stub_addr = StubCode::BreakpointReturnEntryPoint(); 46 uword stub_addr = StubCode::BreakpointReturnEntryPoint();
47 code[0] = 0xE8; 47 code[0] = 0xE8;
48 *reinterpret_cast<uword*>(&code[1]) = stub_addr - pc_; 48 *reinterpret_cast<uword*>(&code[1]) = stub_addr - pc_;
49 CPU::FlushICache(pc_, 5); 49 CPU::FlushICache(pc_ - 5, 5);
50 } 50 }
51 51
52 52
53 void CodeBreakpoint::RestoreFunctionReturn() { 53 void CodeBreakpoint::RestoreFunctionReturn() {
54 uint8_t* code = reinterpret_cast<uint8_t*>(pc_ - 5); 54 uint8_t* code = reinterpret_cast<uint8_t*>(pc_ - 5);
55 ASSERT(code[0] == 0xE8); 55 ASSERT(code[0] == 0xE8);
56 code[0] = 0x89; 56 code[0] = 0x89;
57 code[1] = 0xEC; // mov esp,ebp 57 code[1] = 0xEC; // mov esp,ebp
58 code[2] = 0x5D; // pop ebp 58 code[2] = 0x5D; // pop ebp
59 code[3] = 0xC3; // ret 59 code[3] = 0xC3; // ret
60 code[4] = 0x90; // nop 60 code[4] = 0x90; // nop
61 CPU::FlushICache(pc_, 5); 61 CPU::FlushICache(pc_ - 5, 5);
62 } 62 }
63 63
64 64
65 65
66 } // namespace dart 66 } // namespace dart
67 67
68 #endif // defined TARGET_ARCH_IA32 68 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/debugger_arm.cc ('k') | runtime/vm/debugger_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698