summaryrefslogtreecommitdiff
path: root/deps/v8/src/debug.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-06-15 14:52:00 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-06-15 14:52:00 -0700
commitbc76624ec72792b23b4e951ef1ee8b95b454aa34 (patch)
treec5012b8980ec1b7e00be02b87da720a5e55abf7a /deps/v8/src/debug.cc
parentf3cd7bbe778bb69251637d49a33ddacc0973e973 (diff)
downloadnode-new-bc76624ec72792b23b4e951ef1ee8b95b454aa34.tar.gz
Upgrade V8 to 2.2.17
Diffstat (limited to 'deps/v8/src/debug.cc')
-rw-r--r--deps/v8/src/debug.cc34
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;