OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 | 2352 |
2353 // Move back to where the call instruction sequence started. | 2353 // Move back to where the call instruction sequence started. |
2354 thread_local_.after_break_target_ = | 2354 thread_local_.after_break_target_ = |
2355 addr - Assembler::kPatchReturnSequenceAddressOffset; | 2355 addr - Assembler::kPatchReturnSequenceAddressOffset; |
2356 } else if (at_debug_break_slot) { | 2356 } else if (at_debug_break_slot) { |
2357 // Address of where the debug break slot starts. | 2357 // Address of where the debug break slot starts. |
2358 addr = addr - Assembler::kPatchDebugBreakSlotAddressOffset; | 2358 addr = addr - Assembler::kPatchDebugBreakSlotAddressOffset; |
2359 | 2359 |
2360 // Continue just after the slot. | 2360 // Continue just after the slot. |
2361 thread_local_.after_break_target_ = addr + Assembler::kDebugBreakSlotLength; | 2361 thread_local_.after_break_target_ = addr + Assembler::kDebugBreakSlotLength; |
2362 } else if (IsDebugBreak(Assembler::target_address_at(addr))) { | 2362 } else if (IsDebugBreak(Assembler::target_address_at(addr, *code))) { |
2363 // We now know that there is still a debug break call at the target address, | 2363 // We now know that there is still a debug break call at the target address, |
2364 // so the break point is still there and the original code will hold the | 2364 // so the break point is still there and the original code will hold the |
2365 // address to jump to in order to complete the call which is replaced by a | 2365 // address to jump to in order to complete the call which is replaced by a |
2366 // call to DebugBreakXXX. | 2366 // call to DebugBreakXXX. |
2367 | 2367 |
2368 // Find the corresponding address in the original code. | 2368 // Find the corresponding address in the original code. |
2369 addr += original_code->instruction_start() - code->instruction_start(); | 2369 addr += original_code->instruction_start() - code->instruction_start(); |
2370 | 2370 |
2371 // Install jump to the call address in the original code. This will be the | 2371 // Install jump to the call address in the original code. This will be the |
2372 // call which was overwritten by the call to DebugBreakXXX. | 2372 // call which was overwritten by the call to DebugBreakXXX. |
2373 thread_local_.after_break_target_ = Assembler::target_address_at(addr); | 2373 thread_local_.after_break_target_ = |
| 2374 Assembler::target_address_at(addr, *original_code); |
2374 } else { | 2375 } else { |
2375 // There is no longer a break point present. Don't try to look in the | 2376 // There is no longer a break point present. Don't try to look in the |
2376 // original code as the running code will have the right address. This takes | 2377 // original code as the running code will have the right address. This takes |
2377 // care of the case where the last break point is removed from the function | 2378 // care of the case where the last break point is removed from the function |
2378 // and therefore no "original code" is available. | 2379 // and therefore no "original code" is available. |
2379 thread_local_.after_break_target_ = Assembler::target_address_at(addr); | 2380 thread_local_.after_break_target_ = |
| 2381 Assembler::target_address_at(addr, *code); |
2380 } | 2382 } |
2381 } | 2383 } |
2382 | 2384 |
2383 | 2385 |
2384 bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) { | 2386 bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) { |
2385 HandleScope scope(isolate_); | 2387 HandleScope scope(isolate_); |
2386 | 2388 |
2387 // If there are no break points this cannot be break at return, as | 2389 // If there are no break points this cannot be break at return, as |
2388 // the debugger statement and stack guard bebug break cannot be at | 2390 // the debugger statement and stack guard bebug break cannot be at |
2389 // return. | 2391 // return. |
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3803 { | 3805 { |
3804 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); | 3806 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); |
3805 isolate_->debugger()->CallMessageDispatchHandler(); | 3807 isolate_->debugger()->CallMessageDispatchHandler(); |
3806 } | 3808 } |
3807 } | 3809 } |
3808 } | 3810 } |
3809 | 3811 |
3810 #endif // ENABLE_DEBUGGER_SUPPORT | 3812 #endif // ENABLE_DEBUGGER_SUPPORT |
3811 | 3813 |
3812 } } // namespace v8::internal | 3814 } } // namespace v8::internal |
OLD | NEW |