diff --git a/furdb/include/command.hpp b/furdb/include/command.hpp index 5970bbd..51132c8 100644 --- a/furdb/include/command.hpp +++ b/furdb/include/command.hpp @@ -36,6 +36,16 @@ public: void execute(context& ctx, const command_info& info) override; }; +class continue_command final : public command { +public: + void execute(context& ctx, const command_info& info) override; +}; + +class next_command final : public command { +public: + void execute(context& ctx, const command_info& info) override; +}; + class break_command final : public command { public: void execute(context& ctx, const command_info& info) override; diff --git a/furdb/src/command.cpp b/furdb/src/command.cpp index bc7d627..57317e2 100644 --- a/furdb/src/command.cpp +++ b/furdb/src/command.cpp @@ -71,6 +71,20 @@ void run_command::execute(context& ctx, const command_info& info) { ctx.run(); } +void continue_command::execute(context& ctx, const command_info& info) { + ctx.run(); +} + +void next_command::execute(context& ctx, const command_info& info) { + if (ctx.executor->done()) { + std::cout << "No program's currently running\n"; + return; + } + ctx.executor->unsuspend(); + ctx.executor->step(); + ctx.print_instruction(); +} + static void print_type(const furvm::thing_type& type) { switch (type.type) { case furvm::thing_type::S8: std::cout << "s8"; break; diff --git a/furdb/src/main.cpp b/furdb/src/main.cpp index ba41df5..3a96b35 100644 --- a/furdb/src/main.cpp +++ b/furdb/src/main.cpp @@ -45,6 +45,8 @@ int main(int argc, char** argv) { static std::unordered_map s_commands; s_commands["exit"] = s_commands["quit"] = s_commands["q"] = new quit_command(); s_commands["run"] = s_commands["r"] = new run_command(); + s_commands["continue"] = s_commands["c"] = new continue_command(); + s_commands["next"] = s_commands["n"] = new next_command(); s_commands["break"] = s_commands["b"] = new break_command(); s_commands["info"] = s_commands["i"] = new info_command();