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

Unified Diff: src/debug.cc

Issue 2783002: Better handling of stepping out of a function... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.h ('k') | src/full-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
===================================================================
--- src/debug.cc (revision 4834)
+++ src/debug.cc (working copy)
@@ -1713,6 +1713,40 @@
}
+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;
« no previous file with comments | « src/debug.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698