Commit 1e5fe736 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[debugger] disable break on stack overflow

This partially reverts commit 763f63ff.

Reason for the revert is that the breaking at stack overflow does not
introduce improvement of usability, but rather exposes many issues
caused by the fact that V8 cannot perform a lot of functionality close
to the stack limit.

We keep the test, slightly modified, and use a better way to
detect stack overflow.

Bug: chromium:997469
Change-Id: I32bdf96767812b19f138310cc2dbd6a818fbf031
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1771792Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63426}
parent e101dfb7
......@@ -1795,12 +1795,16 @@ void Debug::OnException(Handle<Object> exception, Handle<Object> promise,
if (it.done()) return; // Do not trigger an event with an empty stack.
}
// Do not trigger exception event on stack overflow. We cannot perform
// anything useful for debugging in that situation.
StackLimitCheck stack_limit_check(isolate_);
if (stack_limit_check.JsHasOverflowed()) return;
DebugScope debug_scope(this);
HandleScope scope(isolate_);
DisableBreak no_recursive_break(this);
Handle<Context> native_context(isolate_->native_context());
AllowJavascriptExecution for_callback(isolate_);
debug_delegate_->ExceptionThrown(
v8::Utils::ToLocal(native_context), v8::Utils::ToLocal(exception),
v8::Utils::ToLocal(promise), uncaught, exception_type);
......
......@@ -3493,12 +3493,11 @@ class ExceptionEventCounter : public v8::debug::DebugDelegate {
int exception_event_count = 0;
};
TEST(BreakOnStackOverflow) {
TEST(NoBreakOnStackOverflow) {
i::FLAG_stack_size = 100;
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
// For this test, we want to break on uncaught exceptions:
ChangeBreakOnException(true, true);
ExceptionEventCounter delegate;
......@@ -3509,7 +3508,7 @@ TEST(BreakOnStackOverflow) {
"function f() { return f(); }"
"try { f() } catch {}");
CHECK_EQ(1, delegate.exception_event_count);
CHECK_EQ(0, delegate.exception_event_count);
}
// Tests that break event is sent when event listener is reset.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment