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

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: addressed comments 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 39d09784cedb7393675088548067cf201a62439c..bcdde57e45eb547fd70a7f016180e18f20cc5731 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1746,6 +1746,38 @@ 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 = IsFrameBlackboxed(it.frame());
+ if (!uncaught || !is_top_frame_blackboxed) return is_top_frame_blackboxed;
+ it.Advance();
+ while (!it.done()) {
+ if (!IsFrameBlackboxed(it.frame())) return false;
+ it.Advance();
+ }
+ return true;
+}
+
+bool Debug::IsFrameBlackboxed(JavaScriptFrame* frame) {
+ HandleScope scope(isolate_);
+ if (!frame->HasInlinedFrames()) {
+ return IsBlackboxed(frame->function()->shared());
+ }
+ List<SharedFunctionInfo*> raw_shareds;
+ frame->GetFunctions(&raw_shareds);
+ List<Handle<SharedFunctionInfo>> shareds;
+ for (int i = 0; i < raw_shareds.length(); ++i) {
+ shareds.Add(handle(raw_shareds[i]));
+ }
+ for (int i = 0; i < shareds.length(); ++i) {
+ if (!IsBlackboxed(shareds[i])) return false;
+ }
+ 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 +1810,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