Commit 3740764c authored by Benedikt Meurer's avatar Benedikt Meurer Committed by V8 LUCI CQ

[debug][cleanup] Use consistent StepInto and StepOver naming.

In the Chrome DevTools Protocol, the step actions are named StepOut,
StepOver, and StepInto, but internally we used StepOut, StepNext, and
StepIn instead. This change adjusts the naming to be consistent.

Bug: chromium:901814, chromium:1162229
Change-Id: Id3502a1b0a4aadd94734ec3d1fef73c1782fa220
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2928510Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74877}
parent c69b0c80
......@@ -107,8 +107,8 @@ void SetBreakPointsActive(Isolate* isolate, bool is_active);
enum StepAction {
StepOut = 0, // Step out of the current function.
StepNext = 1, // Step to the next statement in the current function.
StepIn = 2 // Step into new functions invoked or the next statement
StepOver = 1, // Step to the next statement in the current function.
StepInto = 2 // Step into new functions invoked or the next statement
// in the current function.
};
......
......@@ -500,16 +500,17 @@ void Debug::Break(JavaScriptFrame* frame, Handle<JSFunction> break_target) {
case StepNone:
return;
case StepOut:
// Step out should not break in a deeper frame than target frame.
// StepOut should not break in a deeper frame than target frame.
if (current_frame_count > target_frame_count) return;
step_break = true;
break;
case StepNext:
// Step next should not break in a deeper frame than target frame.
case StepOver:
// StepOver should not break in a deeper frame than target frame.
if (current_frame_count > target_frame_count) return;
V8_FALLTHROUGH;
case StepIn: {
// Special case "next" and "in" for generators that are about to suspend.
case StepInto: {
// Special case StepInto and StepOver for generators that are about to
// suspend.
if (location.IsSuspend()) {
DCHECK(!has_suspended_generator());
thread_local_.suspended_generator_ =
......@@ -924,7 +925,7 @@ void Debug::ClearBreakOnNextFunctionCall() {
}
void Debug::PrepareStepIn(Handle<JSFunction> function) {
CHECK(last_step_action() >= StepIn || break_on_next_function_call());
CHECK(last_step_action() >= StepInto || break_on_next_function_call());
if (ignore_events()) return;
if (in_debug_scope()) return;
if (break_disabled()) return;
......@@ -940,7 +941,7 @@ void Debug::PrepareStepInSuspendedGenerator() {
if (ignore_events()) return;
if (in_debug_scope()) return;
if (break_disabled()) return;
thread_local_.last_step_action_ = StepIn;
thread_local_.last_step_action_ = StepInto;
UpdateHookOnFunctionCall();
Handle<JSFunction> function(
JSGeneratorObject::cast(thread_local_.suspended_generator_).function(),
......@@ -978,7 +979,7 @@ void Debug::PrepareStepOnThrow() {
// Then skip to the frame we want to break in, then instrument for stepping.
for (; !it.done(); it.Advance()) {
JavaScriptFrame* frame = JavaScriptFrame::cast(it.frame());
if (last_step_action() == StepIn) {
if (last_step_action() == StepInto) {
// Deoptimize frame to ensure calls are checked for step-in.
Deoptimizer::DeoptimizeFunction(frame->function());
}
......@@ -1006,7 +1007,7 @@ void Debug::PrepareStepOnThrow() {
if (found_handler) {
// We found the handler. If we are stepping next or out, we need to
// iterate until we found the suitable target frame to break in.
if ((last_step_action() == StepNext || last_step_action() == StepOut) &&
if ((last_step_action() == StepOver || last_step_action() == StepOut) &&
current_frame_count > thread_local_.target_frame_count_) {
continue;
}
......@@ -1071,14 +1072,14 @@ void Debug::PrepareStep(StepAction step_action) {
thread_local_.ignore_step_into_function_ = *function;
}
step_action = StepOut;
thread_local_.last_step_action_ = StepIn;
thread_local_.last_step_action_ = StepInto;
}
// We need to schedule DebugOnFunction call callback
UpdateHookOnFunctionCall();
// A step-next in blackboxed function is a step-out.
if (step_action == StepNext && IsBlackboxed(shared)) step_action = StepOut;
if (step_action == StepOver && IsBlackboxed(shared)) step_action = StepOut;
thread_local_.last_statement_position_ =
summary.abstract_code()->SourceStatementPosition(summary.code_offset());
......@@ -1136,7 +1137,7 @@ void Debug::PrepareStep(StepAction step_action) {
}
#endif // V8_ENABLE_WEBASSEMBLY
JavaScriptFrame* frame = JavaScriptFrame::cast(frames_it.frame());
if (last_step_action() == StepIn) {
if (last_step_action() == StepInto) {
// Deoptimize frame to ensure calls are checked for step-in.
Deoptimizer::DeoptimizeFunction(frame->function());
}
......@@ -1159,10 +1160,10 @@ void Debug::PrepareStep(StepAction step_action) {
}
break;
}
case StepNext:
case StepOver:
thread_local_.target_frame_count_ = current_frame_count;
V8_FALLTHROUGH;
case StepIn:
case StepInto:
FloodWithOneShot(shared);
break;
}
......@@ -2034,8 +2035,8 @@ void Debug::OnDebugBreak(Handle<FixedArray> break_points_hit,
HandleScope scope(isolate_);
DisableBreak no_recursive_break(this);
if ((lastStepAction == StepAction::StepNext ||
lastStepAction == StepAction::StepIn) &&
if ((lastStepAction == StepAction::StepOver ||
lastStepAction == StepAction::StepInto) &&
ShouldBeSkipped()) {
PrepareStep(lastStepAction);
return;
......@@ -2216,9 +2217,9 @@ void Debug::UpdateState() {
}
void Debug::UpdateHookOnFunctionCall() {
STATIC_ASSERT(LastStepAction == StepIn);
STATIC_ASSERT(LastStepAction == StepInto);
hook_on_function_call_ =
thread_local_.last_step_action_ == StepIn ||
thread_local_.last_step_action_ == StepInto ||
isolate_->debug_execution_mode() == DebugInfo::kSideEffects ||
thread_local_.break_on_next_function_call_;
}
......
......@@ -28,14 +28,14 @@ class JavaScriptFrame;
class JSGeneratorObject;
class StackFrame;
// Step actions. NOTE: These values are in macros.py as well.
// Step actions.
enum StepAction : int8_t {
StepNone = -1, // Stepping not prepared.
StepOut = 0, // Step out of the current function.
StepNext = 1, // Step to the next statement in the current function.
StepIn = 2, // Step into new functions invoked or the next statement
StepOver = 1, // Step to the next statement in the current function.
StepInto = 2, // Step into new functions invoked or the next statement
// in the current function.
LastStepAction = StepIn
LastStepAction = StepInto
};
// Type of exception break. NOTE: These values are in macros.py as well.
......
......@@ -372,7 +372,7 @@ void WasmModuleDebug::PrepareStep() {
i::Isolate* isolate = GetIsolate();
DebugScope debug_scope(isolate->debug());
debug::PrepareStep(reinterpret_cast<v8::Isolate*>(isolate),
debug::StepAction::StepIn);
debug::StepAction::StepInto);
}
template <typename T>
......
......@@ -247,7 +247,7 @@ void V8Debugger::stepIntoStatement(int targetContextGroupId,
if (asyncStepOutOfFunction(targetContextGroupId, true)) return;
m_targetContextGroupId = targetContextGroupId;
m_pauseOnAsyncCall = breakOnAsyncCall;
v8::debug::PrepareStep(m_isolate, v8::debug::StepIn);
v8::debug::PrepareStep(m_isolate, v8::debug::StepInto);
continueProgram(targetContextGroupId);
}
......@@ -256,7 +256,7 @@ void V8Debugger::stepOverStatement(int targetContextGroupId) {
DCHECK(targetContextGroupId);
if (asyncStepOutOfFunction(targetContextGroupId, true)) return;
m_targetContextGroupId = targetContextGroupId;
v8::debug::PrepareStep(m_isolate, v8::debug::StepNext);
v8::debug::PrepareStep(m_isolate, v8::debug::StepOver);
continueProgram(targetContextGroupId);
}
......
......@@ -681,7 +681,7 @@ RUNTIME_FUNCTION(Runtime_DebugOnFunctionCall) {
if (isolate->debug()->needs_check_on_function_call()) {
// Ensure that the callee will perform debug check on function call too.
Deoptimizer::DeoptimizeFunction(*fun);
if (isolate->debug()->last_step_action() >= StepIn ||
if (isolate->debug()->last_step_action() >= StepInto ||
isolate->debug()->break_on_next_function_call()) {
DCHECK_EQ(isolate->debug_execution_mode(), DebugInfo::kBreakpoints);
isolate->debug()->PrepareStepIn(fun);
......
......@@ -440,7 +440,7 @@ class DebugInfoImpl {
bool IsStepping(WasmFrame* frame) {
Isolate* isolate = frame->wasm_instance().GetIsolate();
if (isolate->debug()->last_step_action() == StepIn) return true;
if (isolate->debug()->last_step_action() == StepInto) return true;
base::MutexGuard guard(&mutex_);
auto it = per_isolate_data_.find(isolate);
return it != per_isolate_data_.end() &&
......
......@@ -42,10 +42,10 @@
#include "test/cctest/cctest.h"
using ::v8::internal::Handle;
using ::v8::internal::StepInto; // From StepAction enum
using ::v8::internal::StepNone; // From StepAction enum
using ::v8::internal::StepIn; // From StepAction enum
using ::v8::internal::StepNext; // From StepAction enum
using ::v8::internal::StepOut; // From StepAction enum
using ::v8::internal::StepOut; // From StepAction enum
using ::v8::internal::StepOver; // From StepAction enum
// --- H e l p e r F u n c t i o n s
......@@ -1873,7 +1873,7 @@ TEST(DebugStepLinear) {
SetBreakPoint(foo, 3);
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Context> context = env.local();
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
......@@ -1940,7 +1940,7 @@ TEST(DebugStepKeyedLoadLoop) {
// Set up break point and step through the function.
SetBreakPoint(foo, 3);
run_step.set_step_action(StepNext);
run_step.set_step_action(StepOver);
break_point_hit_count = 0;
foo->Call(context, env->Global(), kArgc, args).ToLocalChecked();
......@@ -1991,7 +1991,7 @@ TEST(DebugStepKeyedStoreLoop) {
// Set up break point and step through the function.
SetBreakPoint(foo, 3);
run_step.set_step_action(StepNext);
run_step.set_step_action(StepOver);
break_point_hit_count = 0;
foo->Call(context, env->Global(), kArgc, args).ToLocalChecked();
......@@ -2037,7 +2037,7 @@ TEST(DebugStepNamedLoadLoop) {
// Set up break point and step through the function.
SetBreakPoint(foo, 4);
run_step.set_step_action(StepNext);
run_step.set_step_action(StepOver);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
......@@ -2074,7 +2074,7 @@ static void DoDebugStepNamedStoreLoop(int expected) {
// Set up break point and step through the function.
SetBreakPoint(foo, 3);
run_step.set_step_action(StepNext);
run_step.set_step_action(StepOver);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
......@@ -2113,7 +2113,7 @@ TEST(DebugStepLinearMixedICs) {
SetBreakPoint(foo, 0);
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
......@@ -2163,7 +2163,7 @@ TEST(DebugStepDeclarations) {
SetBreakPoint(foo, 0);
// Stepping through the declarations.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
CHECK_EQ(5, break_point_hit_count);
......@@ -2198,7 +2198,7 @@ TEST(DebugStepLocals) {
SetBreakPoint(foo, 0);
// Stepping through the declarations.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
CHECK_EQ(5, break_point_hit_count);
......@@ -2236,14 +2236,14 @@ TEST(DebugStepIf) {
SetBreakPoint(foo, 0);
// Stepping through the true part.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_true[argc] = {v8::True(isolate)};
foo->Call(context, env->Global(), argc, argv_true).ToLocalChecked();
CHECK_EQ(4, break_point_hit_count);
// Stepping through the false part.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_false[argc] = {v8::False(isolate)};
foo->Call(context, env->Global(), argc, argv_false).ToLocalChecked();
......@@ -2288,21 +2288,21 @@ TEST(DebugStepSwitch) {
SetBreakPoint(foo, 0);
// One case with fall-through.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_1[argc] = {v8::Number::New(isolate, 1)};
foo->Call(context, env->Global(), argc, argv_1).ToLocalChecked();
CHECK_EQ(6, break_point_hit_count);
// Another case.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_2[argc] = {v8::Number::New(isolate, 2)};
foo->Call(context, env->Global(), argc, argv_2).ToLocalChecked();
CHECK_EQ(5, break_point_hit_count);
// Last case.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_3[argc] = {v8::Number::New(isolate, 3)};
foo->Call(context, env->Global(), argc, argv_3).ToLocalChecked();
......@@ -2338,21 +2338,21 @@ TEST(DebugStepWhile) {
SetBreakPoint(foo, 8); // "var a = 0;"
// Looping 0 times. We still should break at the while-condition once.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_0[argc] = {v8::Number::New(isolate, 0)};
foo->Call(context, env->Global(), argc, argv_0).ToLocalChecked();
CHECK_EQ(3, break_point_hit_count);
// Looping 10 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_10[argc] = {v8::Number::New(isolate, 10)};
foo->Call(context, env->Global(), argc, argv_10).ToLocalChecked();
CHECK_EQ(23, break_point_hit_count);
// Looping 100 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_100[argc] = {v8::Number::New(isolate, 100)};
foo->Call(context, env->Global(), argc, argv_100).ToLocalChecked();
......@@ -2388,21 +2388,21 @@ TEST(DebugStepDoWhile) {
SetBreakPoint(foo, 8); // "var a = 0;"
// Looping 0 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_0[argc] = {v8::Number::New(isolate, 0)};
foo->Call(context, env->Global(), argc, argv_0).ToLocalChecked();
CHECK_EQ(4, break_point_hit_count);
// Looping 10 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_10[argc] = {v8::Number::New(isolate, 10)};
foo->Call(context, env->Global(), argc, argv_10).ToLocalChecked();
CHECK_EQ(22, break_point_hit_count);
// Looping 100 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_100[argc] = {v8::Number::New(isolate, 100)};
foo->Call(context, env->Global(), argc, argv_100).ToLocalChecked();
......@@ -2439,21 +2439,21 @@ TEST(DebugStepFor) {
SetBreakPoint(foo, 8); // "a = 1;"
// Looping 0 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_0[argc] = {v8::Number::New(isolate, 0)};
foo->Call(context, env->Global(), argc, argv_0).ToLocalChecked();
CHECK_EQ(4, break_point_hit_count);
// Looping 10 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_10[argc] = {v8::Number::New(isolate, 10)};
foo->Call(context, env->Global(), argc, argv_10).ToLocalChecked();
CHECK_EQ(34, break_point_hit_count);
// Looping 100 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_100[argc] = {v8::Number::New(isolate, 100)};
foo->Call(context, env->Global(), argc, argv_100).ToLocalChecked();
......@@ -2498,7 +2498,7 @@ TEST(DebugStepForContinue) {
// Each loop generates 4 or 5 steps depending on whether a is equal.
// Looping 10 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_10[argc] = {v8::Number::New(isolate, 10)};
result = foo->Call(context, env->Global(), argc, argv_10).ToLocalChecked();
......@@ -2506,7 +2506,7 @@ TEST(DebugStepForContinue) {
CHECK_EQ(62, break_point_hit_count);
// Looping 100 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_100[argc] = {v8::Number::New(isolate, 100)};
result = foo->Call(context, env->Global(), argc, argv_100).ToLocalChecked();
......@@ -2553,7 +2553,7 @@ TEST(DebugStepForBreak) {
// which only generates 4.
// Looping 10 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_10[argc] = {v8::Number::New(isolate, 10)};
result = foo->Call(context, env->Global(), argc, argv_10).ToLocalChecked();
......@@ -2561,7 +2561,7 @@ TEST(DebugStepForBreak) {
CHECK_EQ(64, break_point_hit_count);
// Looping 100 times.
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
v8::Local<v8::Value> argv_100[argc] = {v8::Number::New(isolate, 100)};
result = foo->Call(context, env->Global(), argc, argv_100).ToLocalChecked();
......@@ -2596,7 +2596,7 @@ TEST(DebugStepForIn) {
foo = CompileFunction(&env, src_1, "foo");
SetBreakPoint(foo, 0); // "var a = ..."
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
CHECK_EQ(8, break_point_hit_count);
......@@ -2613,7 +2613,7 @@ TEST(DebugStepForIn) {
foo = CompileFunction(&env, src_2, "foo");
SetBreakPoint(foo, 0); // "var a = ..."
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
CHECK_EQ(10, break_point_hit_count);
......@@ -2649,7 +2649,7 @@ TEST(DebugStepWith) {
v8::Local<v8::Value> result;
SetBreakPoint(foo, 8); // "var a = {};"
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
CHECK_EQ(4, break_point_hit_count);
......@@ -2680,12 +2680,12 @@ TEST(DebugConditional) {
v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
SetBreakPoint(foo, 0); // "var a;"
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
CHECK_EQ(2, break_point_hit_count);
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
const int argc = 1;
v8::Local<v8::Value> argv_true[argc] = {v8::True(isolate)};
......@@ -2711,7 +2711,7 @@ TEST(DebugStepNatives) {
v8::debug::SetDebugDelegate(env->GetIsolate(), &run_step);
v8::Local<v8::Context> context = env.local();
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
......@@ -2752,7 +2752,7 @@ TEST(DebugStepFunctionApply) {
v8::debug::SetDebugDelegate(env->GetIsolate(), &run_step);
v8::Local<v8::Context> context = env.local();
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
......@@ -2800,7 +2800,7 @@ TEST(DebugStepFunctionCall) {
// Register a debug event listener which steps and counts.
DebugEventCounter run_step;
v8::debug::SetDebugDelegate(env->GetIsolate(), &run_step);
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
// Check stepping where the if condition in bar is false.
break_point_hit_count = 0;
......@@ -2853,7 +2853,7 @@ TEST(DebugStepFunctionCallApply) {
// Register a debug event listener which steps and counts.
DebugEventCounter run_step;
v8::debug::SetDebugDelegate(env->GetIsolate(), &run_step);
run_step.set_step_action(StepIn);
run_step.set_step_action(StepInto);
break_point_hit_count = 0;
foo->Call(context, env->Global(), 0, nullptr).ToLocalChecked();
......@@ -3874,7 +3874,7 @@ static void RunScriptInANewCFrame(const char* source) {
TEST(Regress131642) {
// Bug description:
// When doing StepNext through the first script, the debugger is not reset
// When doing StepOver through the first script, the debugger is not reset
// after exiting through exception. A flawed implementation enabling the
// debugger to step into Array.prototype.forEach breaks inside the callback
// for forEach in the second script under the assumption that we are in a
......@@ -3884,7 +3884,7 @@ TEST(Regress131642) {
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
DebugEventCounter delegate;
delegate.set_step_action(StepNext);
delegate.set_step_action(StepOver);
v8::debug::SetDebugDelegate(env->GetIsolate(), &delegate);
// We step through the first script. It exits through an exception. We run
......@@ -4073,7 +4073,7 @@ class ArchiveRestoreThread : public v8::base::Thread,
// statement. If debug->{Archive,Restore}Debug() improperly reset
// thread-local debug information, the debugger will fail to stop
// before the test function returns.
debug_->PrepareStep(StepNext);
debug_->PrepareStep(StepOver);
// Spawning threads while handling the current breakpoint verifies
// that the parent thread correctly archived and restored the
......@@ -4277,7 +4277,7 @@ class DebugStepOverFunctionWithCaughtExceptionListener
inspector_break_points_hit) override {
++break_point_hit_count;
if (break_point_hit_count >= 3) return;
PrepareStep(StepNext);
PrepareStep(StepOver);
}
int break_point_hit_count = 0;
};
......
......@@ -75,8 +75,8 @@ class BreakHandler : public debug::DebugDelegate {
public:
enum Action {
Continue = StepAction::LastStepAction + 1,
StepNext = StepAction::StepNext,
StepIn = StepAction::StepIn,
StepOver = StepAction::StepOver,
StepInto = StepAction::StepInto,
StepOut = StepAction::StepOut
};
struct BreakPoint {
......@@ -124,8 +124,8 @@ class BreakHandler : public debug::DebugDelegate {
switch (next_action) {
case Continue:
break;
case StepNext:
case StepIn:
case StepOver:
case StepInto:
case StepOut:
isolate_->debug()->PrepareStep(static_cast<StepAction>(next_action));
break;
......@@ -249,7 +249,7 @@ class CollectValuesBreakHandler : public debug::DebugDelegate {
CHECK_EQ(WasmValWrapper{expected.stack[i]}, WasmValWrapper{stack_value});
}
isolate_->debug()->PrepareStep(StepAction::StepIn);
isolate_->debug()->PrepareStep(StepAction::StepInto);
}
};
......@@ -355,8 +355,8 @@ WASM_COMPILED_EXEC_TEST(WasmSimpleStepping) {
BreakHandler count_breaks(isolate,
{
{1, BreakHandler::StepNext}, // I32Const
{3, BreakHandler::StepNext}, // I32Const
{1, BreakHandler::StepOver}, // I32Const
{3, BreakHandler::StepOver}, // I32Const
{5, BreakHandler::Continue} // I32Add
});
......@@ -396,10 +396,10 @@ WASM_COMPILED_EXEC_TEST(WasmStepInAndOut) {
BreakHandler count_breaks(isolate,
{
{19, BreakHandler::StepIn}, // LocalGet
{21, BreakHandler::StepIn}, // Call
{1, BreakHandler::StepOut}, // in f2
{23, BreakHandler::Continue} // After Call
{19, BreakHandler::StepInto}, // LocalGet
{21, BreakHandler::StepInto}, // Call
{1, BreakHandler::StepOut}, // in f2
{23, BreakHandler::Continue} // After Call
});
Handle<Object> global(isolate->context().global_object(), isolate);
......
......@@ -23,7 +23,7 @@ function listener(event, exec_state, event_data, data) {
++break_count;
if (break_count !== expected_breaks) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
print("Next step prepared");
}
}
......
......@@ -12,7 +12,7 @@ function listener(event, exec_state, event_data, data) {
var line = exec_state.frame(0).sourceLineText();
log.push(line);
if (!/STOP/.test(line)) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
} catch (e) {
......
......@@ -9,7 +9,7 @@ var exception = null;
function breakListener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
// Assert that the break happens at an intended location.
assertTrue(exec_state.frame(0).sourceLineText().indexOf("// break") > 0);
} catch (e) {
......
......@@ -33,7 +33,7 @@ function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break)
{
call_graph += exec_state.frame().func().name();
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
};
......
......@@ -33,7 +33,7 @@ function listener(event, exec_state, event_data, data) {
assertEquals(2, match.length);
log.push(match[1] + col);
if (match[1] != "v") {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
} catch (e) {
exception = e;
......
......@@ -59,7 +59,7 @@ function listener(event, exec_state, event_data, data) {
default:
fail("Unexpected");
}
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} else {
// Position at the end of the function.
assertEquals(expected_source_position.shift() + debugger_source_position,
......
......@@ -10,7 +10,7 @@ function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
assertEquals(expected.shift(), exec_state.frame(0).sourceLineText());
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -14,7 +14,7 @@ function listener(event, exec_state, event_data, data) {
print(event_data.sourceLineText());
assertTrue(
event_data.sourceLineText().indexOf(`Break ${break_count++}.`) > 0);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -13,7 +13,7 @@ function listener(event, exec_state, event_data, data) {
try {
print(event_data.sourceLineText());
assertTrue(event_data.sourceLineText().indexOf(`Break ${break_count++}.`) > 0);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -12,7 +12,7 @@ function listener(event, exec_state, event_data, data) {
var line = exec_state.frame(0).sourceLineText();
log.push(line);
if (!/STOP/.test(line)) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
} catch (e) {
......
......@@ -34,7 +34,7 @@ function listener(event, exec_state, event_data, data) {
break_break_point_hit_count++;
// Continue stepping until returned to bottom frame.
if (exec_state.frameCount() > 1) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
};
......
......@@ -33,7 +33,7 @@ var break_count = 0;
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
print(exec_state.frame(0).sourceLineText());
var match = exec_state.frame(0).sourceLineText().match(/Break (\d)/);
assertNotNull(match);
......
......@@ -15,7 +15,7 @@ var bp1, bp2;
function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break) {
if (step_count > 0) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
step_count--;
} else {
result = exec_state.frame().evaluate("i").value();
......
......@@ -30,7 +30,7 @@ function listener(event, exec_state, event_data, data) {
try {
var source_line = exec_state.frame(0).sourceLineText();
assertTrue(source_line.indexOf("// Break") > 0);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
break_count++;
} catch (e) {
exception = e;
......
......@@ -45,7 +45,7 @@ function listener(event, exec_state, event_data, data) {
assertEquals(expected_function_name, event_data.func().name());
state = 4;
} else {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
state++;
}
}
......
......@@ -14,7 +14,7 @@ function listener(event, exec_state, event_data, data) {
print(event_data.sourceLineText());
assertTrue(
event_data.sourceLineText().indexOf(`Break ${break_count++}.`) > 0);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -37,7 +37,7 @@ function array_listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break) {
print(event_data.sourceLineText(), breaks);
assertTrue(event_data.sourceLineText().indexOf(`B${breaks++}`) > 0);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
} catch (e) {
print(e);
......
......@@ -45,7 +45,7 @@ function listener(event, exec_state, event_data, data) {
event_data.sourceLineText());
state = 4;
} else {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
state++;
}
}
......
......@@ -42,7 +42,7 @@ function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break) {
if (state < step_in_count) {
// Step into f().
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
state++;
} else {
assertEquals(expected_source_line_text,
......
......@@ -11,7 +11,7 @@ function listener(event, exec_state, event_data, data) {
try {
var source_line = exec_state.frame(0).sourceLineText();
print(source_line);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
break_count++;
} catch (e) {
exception = e;
......
......@@ -34,7 +34,7 @@ function listener(event, exec_state, event_data, data) {
break_break_point_hit_count++;
// Continue stepping until returned to bottom frame.
if (exec_state.frameCount() > 1) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
};
......
......@@ -20,7 +20,7 @@ function listener(event, exec_state, event_data, data) {
"Expected: // Break " + break_count + ".");
++break_count;
if (break_count !== expected_breaks) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
} catch(e) {
......
......@@ -38,7 +38,7 @@ function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break) {
if (state < 2) {
// Step into f2.call:
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
state++;
} else {
assertEquals('g', event_data.func().name());
......
......@@ -38,7 +38,7 @@ function listener(event, exec_state, event_data, data) {
try {
if (event == Debug.DebugEvent.Break) {
if (state < 4) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
state++;
} else {
assertTrue(event_data.sourceLineText().indexOf("Expected to step") > 0,
......
......@@ -46,7 +46,7 @@ function listener(event, exec_state, event_data, data) {
break_break_point_hit_count++;
// Continue stepping until returned to bottom frame.
if (exec_state.frameCount() > 1) {
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
}
}
......
......@@ -43,7 +43,7 @@ function listener(event, exec_state, event_data, data) {
}
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -43,7 +43,7 @@ function listener(event, exec_state, event_data, data) {
}
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -43,7 +43,7 @@ function listener(event, exec_state, event_data, data) {
}
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -43,7 +43,7 @@ function listener(event, exec_state, event_data, data) {
}
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -43,7 +43,7 @@ function listener(event, exec_state, event_data, data) {
}
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -43,7 +43,7 @@ function listener(event, exec_state, event_data, data) {
}
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -43,7 +43,7 @@ function listener(event, exec_state, event_data, data) {
}
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -43,7 +43,7 @@ function listener(event, exec_state, event_data, data) {
}
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -13,7 +13,7 @@ var step_count = 0;
function listener(event, execState, eventData, data) {
if (event != Debug.DebugEvent.Break) return;
try {
execState.prepareStep(Debug.StepAction.StepIn);
execState.prepareStep(Debug.StepAction.StepInto);
var s = execState.frame().sourceLineText();
step_count++;
assertTrue(s.indexOf('// ' + step_count + '.') >= 0);
......
......@@ -11,7 +11,7 @@ function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
breaks.push(exec_state.frame(0).sourceLineText().trimLeft());
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -21,7 +21,7 @@ function listener(event, exec_state, event_data, data) {
"Expected: // Break " + break_count + ".");
++break_count;
if (break_count !== expected_breaks) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
} catch(e) {
......
......@@ -14,9 +14,9 @@ function listener(event, exec_state, event_data, data) {
print(source);
assertTrue(source.indexOf(`// B${break_count++}`) > 0);
if (source.indexOf("assertEquals") > 0) {
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
} else {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
} catch (e) {
exception = e;
......
......@@ -14,9 +14,9 @@ function listener(event, exec_state, event_data, data) {
print(source, break_count);
assertTrue(source.indexOf(`B${break_count++}`) > 0);
if (source.indexOf("assertEquals") > 0) {
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
} else {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
} catch (e) {
exception = e;
......
......@@ -13,7 +13,7 @@ var stepCount = 0;
function listener(event, execState, eventData, data) {
if (event == Debug.DebugEvent.Break) {
if (!done) {
execState.prepareStep(Debug.StepAction.StepIn);
execState.prepareStep(Debug.StepAction.StepInto);
var s = execState.frame().sourceLineText();
assertTrue(s.indexOf('// ' + stepCount + '.') !== -1);
stepCount++;
......
......@@ -13,7 +13,7 @@ function listener(event, execState, eventData, data) {
if (event != Debug.DebugEvent.Break) return;
try {
if (!done) {
execState.prepareStep(Debug.StepAction.StepIn);
execState.prepareStep(Debug.StepAction.StepInto);
var s = execState.frame().sourceLineText();
assertTrue(s.indexOf('// ' + stepCount + '.') !== -1);
stepCount++;
......
......@@ -14,7 +14,7 @@ function listener(event, exec_state, event_data, data) {
print(event_data.sourceLineText());
assertTrue(
event_data.sourceLineText().indexOf(`Break ${break_count++}.`) > 0);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -10,7 +10,7 @@ var exception = null;
function listener(event, exec_state, event_data, data) {
try {
if (event == Debug.DebugEvent.Break) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
print(event_data.sourceLineText());
assertTrue(
event_data.sourceLineText().indexOf(`B${breaks++}`) > 0);
......
......@@ -18,7 +18,7 @@ function listener(event, exec_state, event_data, data) {
entry += exec_state.frame(i).sourceColumn();
}
log.push(entry);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -17,7 +17,7 @@ function listener(event, exec_state, event_data, data) {
if (yields == 4) {
exec_state.prepareStep(Debug.StepAction.StepOut);
} else {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
} catch (e) {
print(e, e.stack);
......
......@@ -18,11 +18,11 @@ function listener(event, exec_state, event_data, data) {
"Unexpected pause at: " + source + "\n" +
"Expected: // Break " + break_count + ".");
if (source.indexOf("StepOver.") !== -1) {
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
} else if (source.indexOf("StepOut.") !== -1) {
exec_state.prepareStep(Debug.StepAction.StepOut);
} else {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
++break_count;
}
......
......@@ -18,7 +18,7 @@ function listener(event, exec_state, event_data, data) {
entry += exec_state.frame(i).sourceColumn();
}
log.push(entry);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -18,7 +18,7 @@ function listener(event, exec_state, event_data, data) {
entry += exec_state.frame(i).sourceColumn();
}
log.push(entry);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -79,7 +79,7 @@ function listener(event, exec_state, event_data, data) {
var match = line.match(/\/\/ Break (\w)$/);
assertEquals(2, match.length);
log.push(match[1] + col);
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
break_count++;
} catch (e) {
exception = e;
......
......@@ -15,9 +15,9 @@ function listener(event, exec_state, event_data, data) {
if (/step out/.test(source)) {
exec_state.prepareStep(Debug.StepAction.StepOut);
} else if (/step in/.test(source)) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} else {
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
}
} catch (e) {
print(e, e.stack);
......
......@@ -38,7 +38,7 @@ function listener(event, exec_state, event_data, data) {
++break_count;
if (break_count !== expected_breaks) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
print("Next step prepared");
}
}
......
......@@ -33,10 +33,10 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
debugger; // B0 StepOver
a +=
await // B1 StepIn
g(); // B2 StepIn
await // B1 StepInto
g(); // B2 StepInto
return a;
}
......@@ -44,7 +44,7 @@ f();
// Starting a new step action at an intermediate break point
// means that we will abort the current async step.
debugger; // B3 StepNext
debugger; // B3 StepOver
late_resolve(3); // B4 Continue
......
......@@ -33,10 +33,10 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
debugger; // B0 StepOver
a +=
await // B1 StepIn
g(); // B2 StepIn
await // B1 StepInto
g(); // B2 StepInto
return a; // B4 Continue
}
......
......@@ -33,9 +33,9 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
debugger; // B0 StepOver
a +=
await // B1 StepIn
await // B1 StepInto
g();
return a; // B3 Continue
}
......
......@@ -33,9 +33,9 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
debugger; // B0 StepOver
a +=
await // B1 StepIn
await // B1 StepInto
g();
return a; // B3 Continue
}
......
......@@ -24,18 +24,18 @@ Debug.setListener(listener);
var late_resolve;
function g() {
return new Promise( // B2 StepIn
return new Promise( // B2 StepInto
function(res, rej) {
late_resolve = res; // B3 StepIn
} // B4 StepIn
); // B5 StepIn
late_resolve = res; // B3 StepInto
} // B4 StepInto
); // B5 StepInto
}
async function f() {
var a = 1;
debugger; // B0 StepNext
debugger; // B0 StepOver
a +=
await // B1 StepIn
await // B1 StepInto
g();
return a; // B6 Continue
}
......
......@@ -33,15 +33,15 @@ function g() {
async function f1() {
var a = 1;
debugger; // B0 StepNext
debugger; // B0 StepOver
a +=
await // B1 StepIn
f2(); // B2 StepIn
await // B1 StepInto
f2(); // B2 StepInto
return a; // B5 Continue
}
async function f2() {
var b = 0 + // B2 StepIn
var b = 0 + // B2 StepInto
await
g();
return b; // B4 StepOut
......
......@@ -23,8 +23,8 @@ Debug.setListener(listener);
async function f() {
var a = 1;
debugger; // B0 StepNext
a += // B1 StepNext
debugger; // B0 StepOver
a += // B1 StepOver
await
5;
return a; // B2 Continue
......
......@@ -33,9 +33,9 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
debugger; // B0 StepOver
a +=
await // B1 StepNext
await // B1 StepOver
g();
return a; // B2 Continue
}
......
......@@ -33,7 +33,7 @@ function g() {
async function f() {
var a = 1;
debugger; // B0 StepNext
debugger; // B0 StepOver
a += await g(); // B1 StepOut
return a;
}
......
......@@ -12,7 +12,7 @@ function listener(event, exec_state, event_data, data) {
// Access scope details to check the context is correct.
var scope_count = exec_state.frame().scopeCount();
// Do steps until we reach the global scope again.
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
}
......
......@@ -37,7 +37,7 @@ var values = [];
// Debug event listener which steps until the global variable done is true.
function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break) {
if (!done) exec_state.prepareStep(Debug.StepAction.StepNext);
if (!done) exec_state.prepareStep(Debug.StepAction.StepOver);
step_count++;
}
};
......
......@@ -15,7 +15,7 @@ function listener(event, exec_state, event_data, data) {
var column = event_data.sourceColumn();
assertTrue(event_data.sourceLineText().indexOf(
`Break ${break_count++}. ${column}.`) > 0);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
print(e + e.stack);
exception = e;
......
......@@ -29,7 +29,7 @@
Debug = debug.Debug
function breakListener(event, exec_state, event_data, data) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
Debug.setListener(breakListener);
......
......@@ -32,7 +32,7 @@ function listener(event, exec_state, event_data, data) {
for (var i = 0, n = exec_state.frameCount(); i < n; i++) {
exec_state.frame().scopeCount(i);
}
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
}
Debug.setListener(listener);
......
......@@ -30,7 +30,7 @@ Debug = debug.Debug;
function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break) {
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
}
};
......
......@@ -39,7 +39,7 @@ function listener(event, exec_state, event_data, data) {
"should not break on unexpected lines")
assertEquals('BREAK ' + breaks, line.substr(-7));
breaks++;
if (breaks < 4) exec_state.prepareStep(Debug.StepAction.StepNext);
if (breaks < 4) exec_state.prepareStep(Debug.StepAction.StepOver);
}
} catch (e) {
print(e);
......
......@@ -29,7 +29,7 @@ Debug = debug.Debug
function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Break) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
};
......
......@@ -18,7 +18,7 @@ function listener(event, exec_state, event_data, data) {
try {
Debug.debuggerFlags().breakPointsActive.setValue(false);
breaks.push(exec_state.frame().sourceLineText().trimLeft());
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
}
......
......@@ -9,7 +9,7 @@ var exception = null;
function listener(event, exec_state, event_data, data) {
try {
if (event == Debug.DebugEvent.Break) {
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
}
} catch (e) {
exception = e;
......
......@@ -17,7 +17,7 @@ function listener(event, exec_state, event_data, data) {
if (exec_state.frame(0).sourceLineText().indexOf("Break") <0) {
error_count++;
}
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
f(); // We should not break in this call of f().
} catch (e) {
print(e + e.stack);
......
......@@ -19,7 +19,7 @@ function listener(event, exec_state, event_data, data) {
var label = +exec_state.frame(0).sourceLineText().substr(-1);
log.push(label);
if (label == 2) log.push(exec_state.frame(0).evaluate("i").value());
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
} catch (e) {
exception = e;
print("Caught something. " + e + " " + e.stack);
......
......@@ -14,7 +14,7 @@ function listener(event, exec_state, event_data, data) {
try {
var line = exec_state.frame(0).sourceLineText().trimLeft();
log.push(line);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepNext);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepOver);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -15,7 +15,7 @@ function listener(event, exec_state, event_data, data) {
try {
var line = exec_state.frame(0).sourceLineText().trimLeft();
assertEquals(expected.shift(), line);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepNext);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepOver);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -13,7 +13,7 @@ function listener(event, exec_state, event_data, data) {
try {
var line = exec_state.frame(0).sourceLineText().trimLeft();
log.push(line);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepNext);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepOver);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -12,7 +12,7 @@ function listener(event, exec_state, event_data, data) {
try {
var line = exec_state.frame(0).sourceLineText().trimLeft();
log.push(line);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepNext);
if (line == "debugger;") exec_state.prepareStep(Debug.StepAction.StepOver);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
......
......@@ -17,7 +17,7 @@ function listener(event, execState, eventData, data) {
var x_value = execState.frame().evaluate("String(x)").value();
if (steps < 2) {
assertEquals("undefined", x_value);
execState.prepareStep(Debug.StepAction.StepIn);
execState.prepareStep(Debug.StepAction.StepInto);
} else {
assertEquals("l => l", x_value);
}
......
......@@ -39,7 +39,7 @@ function listener(event, exec_state, event_data, data) {
assertTrue(event_data.functionName() == '$sub');
wasm_break_count++;
}
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
exception = e;
print(e);
......
......@@ -60,7 +60,7 @@ function onBreak(event, exec_state, data) {
assertTrue(expected_breaks.length > 0, 'expecting more breaks');
const expected_pos = expected_breaks.shift();
assertEquals(expected_pos, pos);
exec_state.prepareStep(Debug.StepAction.StepIn);
exec_state.prepareStep(Debug.StepAction.StepInto);
} catch (e) {
if (!error) error = e;
}
......
......@@ -23,9 +23,9 @@ Debug.setListener(listener);
async function f() {
var a = 1;
debugger; // B0 StepNext
print(1); // B1 StepNext
return a + // B2 StepNext
debugger; // B0 StepOver
print(1); // B1 StepOver
return a + // B2 StepOver
0; // B3 Continue
}
......
......@@ -29,7 +29,7 @@ var exception = null;
function listener(event, exec_state, event_data, data) {
if (event == Debug.DebugEvent.Exception) {
step_count++;
exec_state.prepareStep(Debug.StepAction.StepNext);
exec_state.prepareStep(Debug.StepAction.StepOver);
} else if (event == Debug.DebugEvent.Break) {
step_count++;
try {
......
......@@ -28,7 +28,7 @@ function listener(event, exec_state, event_data, data) {
}
scopes_checked = true;
}
if (step_count++ < 3) exec_state.prepareStep(Debug.StepAction.StepNext);
if (step_count++ < 3) exec_state.prepareStep(Debug.StepAction.StepOver);
} catch (e) {
exception = e;
print(e, e.stack);
......
......@@ -23,9 +23,9 @@ Debug.setListener((event, execState, eventData, data) => {
});
function f(x) {
debugger; // B0 StepNext
with ({}) { // B1 StepNext
return x // B2 StepNext
debugger; // B0 StepOver
with ({}) { // B1 StepOver
return x // B2 StepOver
; // B3 Continue
}
}
......
......@@ -276,7 +276,7 @@ let break_count = 0;
function listener(event, exec_state, event_data, data) {
if (event != debug.Debug.DebugEvent.Break) return;
try {
exec_state.prepareStep(debug.Debug.StepAction.StepNext);
exec_state.prepareStep(debug.Debug.StepAction.StepOver);
break_count++;
} catch {
%AbortJS("unexpected exception");
......
......@@ -37,8 +37,8 @@ class DebugWrapper {
// The different types of steps.
this.StepAction = { StepOut: 0,
StepNext: 1,
StepIn: 2,
StepOver: 1,
StepInto: 2,
};
// A copy of the scope types from runtime-debug.cc.
......@@ -307,8 +307,8 @@ class DebugWrapper {
execStatePrepareStep(action) {
switch(action) {
case this.StepAction.StepOut: this.stepOut(); break;
case this.StepAction.StepNext: this.stepOver(); break;
case this.StepAction.StepIn: this.stepInto(); break;
case this.StepAction.StepOver: this.stepOver(); break;
case this.StepAction.StepInto: this.stepInto(); break;
default: %AbortJS("Unsupported StepAction"); break;
}
}
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(kozyatinskiy): on StepOut and probably StepNext at return position
// TODO(kozyatinskiy): on StepOut and probably StepOver at return position
// of async generator we should break at next instruction of resumed generator
// instead of next scheduled microtask.
......
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