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

Unified Diff: src/debug/debug.cc

Issue 2651683005: [inspector] don't ignore uncaught exception if at least 1 frame isn't blackboxed (Closed)
Patch Set: Created 3 years, 11 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/debug.h ('k') | test/inspector/debugger/framework-break.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 418b8eb2481d84020a22a43658aabed70412edd3..0a4a8ad64823ccef4e944f680655269999e8af5d 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1746,6 +1746,21 @@ v8::Local<v8::Context> GetDebugEventContext(Isolate* isolate) {
}
} // anonymous namespace
+bool Debug::IsExceptionBlackboxed(bool uncaught) {
+ JavaScriptFrameIterator it(isolate_);
+ if (it.done()) return false;
+ // Uncaught exception is blackboxed if all current frames are blackboxed,
+ // caught exception if top frame is blackboxed.
+ bool is_top_frame_blackboxed = IsBlackboxed(it.frame()->function()->shared());
Yang 2017/01/25 10:10:15 This doesn't account for inlined frames. Please us
kozy 2017/01/25 17:39:26 Done + added a test.
+ if (!uncaught || !is_top_frame_blackboxed) return is_top_frame_blackboxed;
+ it.Advance();
+ while (!it.done()) {
+ if (!IsBlackboxed(it.frame()->function()->shared())) return false;
+ it.Advance();
+ }
+ return true;
+}
+
void Debug::OnException(Handle<Object> exception, Handle<Object> promise) {
// We cannot generate debug events when JS execution is disallowed.
// TODO(5530): Reenable debug events within DisallowJSScopes once relevant
@@ -1778,8 +1793,8 @@ void Debug::OnException(Handle<Object> exception, Handle<Object> promise) {
{
JavaScriptFrameIterator it(isolate_);
// Check whether the top frame is blackboxed or the break location is muted.
- if (!it.done() && (IsBlackboxed(it.frame()->function()->shared()) ||
- IsMutedAtCurrentLocation(it.frame()))) {
+ if (!it.done() && (IsMutedAtCurrentLocation(it.frame()) ||
+ IsExceptionBlackboxed(uncaught))) {
return;
}
}
« no previous file with comments | « src/debug/debug.h ('k') | test/inspector/debugger/framework-break.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698