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

Unified Diff: src/runtime/runtime-debug.cc

Issue 1234833003: Debugger: use debug break slots to break at function exit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase, clean ups, x64 port. Created 5 years, 5 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
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index 660734fa52daf90017cb7c1b002aded3a1a94a99..08fca548f1913b497b13432c548ddcc53dc3888f 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -1390,19 +1390,13 @@ class ScopeIterator {
return;
}
- // Get the debug info (create it if it does not exist).
- if (!isolate->debug()->EnsureDebugInfo(shared_info, function_)) {
- // Return if ensuring debug info failed.
- return;
- }
-
// Currently it takes too much time to find nested scopes due to script
// parsing. Sometimes we want to run the ScopeIterator as fast as possible
// (for example, while collecting async call stacks on every
// addEventListener call), even if we drop some nested scopes.
// Later we may optimize getting the nested scopes (cache the result?)
// and include nested scopes into the "fast" iteration case as well.
- if (!ignore_nested_scopes) {
+ if (!ignore_nested_scopes && !shared_info->debug_info()->IsUndefined()) {
ulan 2015/07/14 09:12:45 What happens if there is no debug info?
Yang 2015/07/14 12:00:57 We can only ever end up here from a return stateme
Handle<DebugInfo> debug_info = Debug::GetDebugInfo(shared_info);
// PC points to the instruction after the current one, possibly a break
@@ -1413,11 +1407,11 @@ class ScopeIterator {
BreakLocation location =
BreakLocation::FromAddress(debug_info, ALL_BREAK_LOCATIONS, call_pc);
- // Within the return sequence at the moment it is not possible to
- // get a source position which is consistent with the current scope chain.
- // Thus all nested with, catch and block contexts are skipped and we only
- // provide the function scope.
- ignore_nested_scopes = location.IsExit();
+ // With break points we can end up breaking at a return sequence, where
+ // at the moment it is not possible to get a source position which is
+ // consistent with the current scope chain. Thus all nested with, catch
+ // and block contexts are skipped and we only provide the function scope.
+ ignore_nested_scopes = location.IsReturn();
}
if (ignore_nested_scopes) {
« src/liveedit.cc ('K') | « src/objects-printer.cc ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698