diff options
Diffstat (limited to 'deps/v8/src/debug.cc')
-rw-r--r-- | deps/v8/src/debug.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/deps/v8/src/debug.cc b/deps/v8/src/debug.cc index ca20a65b65..98e366c7bc 100644 --- a/deps/v8/src/debug.cc +++ b/deps/v8/src/debug.cc @@ -1713,6 +1713,40 @@ void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) { } +bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) { + HandleScope scope; + + // Get the executing function in which the debug break occurred. + Handle<SharedFunctionInfo> shared = + Handle<SharedFunctionInfo>(JSFunction::cast(frame->function())->shared()); + if (!EnsureDebugInfo(shared)) { + // Return if we failed to retrieve the debug info. + return false; + } + Handle<DebugInfo> debug_info = GetDebugInfo(shared); + Handle<Code> code(debug_info->code()); +#ifdef DEBUG + // Get the code which is actually executing. + Handle<Code> frame_code(frame->code()); + ASSERT(frame_code.is_identical_to(code)); +#endif + + // Find the call address in the running code. + Address addr = frame->pc() - Assembler::kCallTargetAddressOffset; + + // Check if the location is at JS return. + RelocIterator it(debug_info->code()); + while (!it.done()) { + if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { + return (it.rinfo()->pc() == + addr - Assembler::kPatchReturnSequenceAddressOffset); + } + it.next(); + } + return false; +} + + void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id) { thread_local_.frames_are_dropped_ = true; thread_local_.break_frame_id_ = new_break_frame_id; |