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

Side by Side Diff: src/ia32/debug-ia32.cc

Issue 2693002: More precise break points and stepping when debugging... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 6 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 | « src/ia32/codegen-ia32.h ('k') | src/mark-compact.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 63
64 // A debug break in the frame exit code is identified by the JS frame exit code 64 // A debug break in the frame exit code is identified by the JS frame exit code
65 // having been patched with a call instruction. 65 // having been patched with a call instruction.
66 bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) { 66 bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) {
67 ASSERT(RelocInfo::IsJSReturn(rinfo->rmode())); 67 ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
68 return rinfo->IsPatchedReturnSequence(); 68 return rinfo->IsPatchedReturnSequence();
69 } 69 }
70 70
71 71
72 bool BreakLocationIterator::IsDebugBreakAtSlot() {
73 ASSERT(IsDebugBreakSlot());
74 // Check whether the debug break slot instructions have been patched.
75 return rinfo()->IsPatchedDebugBreakSlotSequence();
76 }
77
78
79 void BreakLocationIterator::SetDebugBreakAtSlot() {
80 ASSERT(IsDebugBreakSlot());
81 rinfo()->PatchCodeWithCall(
82 Debug::debug_break_slot()->entry(),
83 Assembler::kDebugBreakSlotLength - Assembler::kCallInstructionLength);
84 }
85
86
87 void BreakLocationIterator::ClearDebugBreakAtSlot() {
88 ASSERT(IsDebugBreakSlot());
89 rinfo()->PatchCode(original_rinfo()->pc(), Assembler::kDebugBreakSlotLength);
90 }
91
92
72 #define __ ACCESS_MASM(masm) 93 #define __ ACCESS_MASM(masm)
73 94
74 95
75 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, 96 static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
76 RegList pointer_regs, 97 RegList pointer_regs,
77 bool convert_call_to_jmp) { 98 bool convert_call_to_jmp) {
78 // Save the content of all general purpose registers in memory. This copy in 99 // Save the content of all general purpose registers in memory. This copy in
79 // memory is later pushed onto the JS expression stack for the fake JS frame 100 // memory is later pushed onto the JS expression stack for the fake JS frame
80 // generated and also to the C frame generated on top of that. In the JS 101 // generated and also to the C frame generated on top of that. In the JS
81 // frame ONLY the registers containing pointers will be pushed on the 102 // frame ONLY the registers containing pointers will be pushed on the
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 222
202 void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) { 223 void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
203 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). 224 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc).
204 // ----------- S t a t e ------------- 225 // ----------- S t a t e -------------
205 // No registers used on entry. 226 // No registers used on entry.
206 // ----------------------------------- 227 // -----------------------------------
207 Generate_DebugBreakCallHelper(masm, 0, false); 228 Generate_DebugBreakCallHelper(masm, 0, false);
208 } 229 }
209 230
210 231
232 void Debug::GenerateSlot(MacroAssembler* masm) {
233 // Generate enough nop's to make space for a call instruction.
234 Label check_codesize;
235 __ bind(&check_codesize);
236 __ RecordDebugBreakSlot();
237 for (int i = 0; i < Assembler::kDebugBreakSlotLength; i++) {
238 __ nop();
239 }
240 ASSERT_EQ(Assembler::kDebugBreakSlotLength,
241 masm->SizeOfCodeGeneratedSince(&check_codesize));
242 }
243
244
245 void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) {
246 // In the places where a debug break slot is inserted no registers can contain
247 // object pointers.
248 Generate_DebugBreakCallHelper(masm, 0, true);
249 }
250
251
211 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { 252 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
212 masm->ret(0); 253 masm->ret(0);
213 } 254 }
214 255
256
215 // FrameDropper is a code replacement for a JavaScript frame with possibly 257 // FrameDropper is a code replacement for a JavaScript frame with possibly
216 // several frames above. 258 // several frames above.
217 // There is no calling conventions here, because it never actually gets called, 259 // There is no calling conventions here, because it never actually gets called,
218 // it only gets returned to. 260 // it only gets returned to.
219 // Frame structure (conforms InternalFrame structure): 261 // Frame structure (conforms InternalFrame structure):
220 // -- JSFunction 262 // -- JSFunction
221 // -- code 263 // -- code
222 // -- SMI maker 264 // -- SMI maker
223 // -- context 265 // -- context
224 // -- frame base 266 // -- frame base
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL); 300 Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL);
259 } 301 }
260 const int Debug::kFrameDropperFrameSize = 5; 302 const int Debug::kFrameDropperFrameSize = 5;
261 303
262 304
263 #endif // ENABLE_DEBUGGER_SUPPORT 305 #endif // ENABLE_DEBUGGER_SUPPORT
264 306
265 } } // namespace v8::internal 307 } } // namespace v8::internal
266 308
267 #endif // V8_TARGET_ARCH_IA32 309 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698