From 019e72a444a0d8eb9d1dc579c01d3eb4509e3fb2 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 1 Jan 2016 11:35:14 +0100 Subject: [PATCH] Added step-over, step-in and step-out functions to debugging menu --- src/files.h | 7 +++++-- src/menu.cc | 17 +++++++++++++++++ src/window.cc | 21 +++++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/files.h b/src/files.h index 34dca1f..ff84cfc 100644 --- a/src/files.h +++ b/src/files.h @@ -2,7 +2,7 @@ #define JUCI_FILES_H_ #include -#define JUCI_VERSION "1.1.0" +#define JUCI_VERSION "1.1.0-1" const std::string configjson = "{\n" @@ -101,9 +101,12 @@ const std::string configjson = " \"debug_start_continue\": \"y\",\n" " \"debug_stop\": \"y\",\n" " \"debug_kill\": \"k\",\n" -" \"debug_goto_stop\": \"l\",\n" +" \"debug_step_over\": \"n\",\n" +" \"debug_step_into\": \"t\",\n" +" \"debug_step_out\": \"t\",\n" " \"debug_run_command\": \"Return\",\n" " \"debug_toggle_breakpoint\": \"b\",\n" +" \"debug_goto_stop\": \"l\",\n" #ifdef __linux " \"next_tab\": \"Tab\",\n" " \"previous_tab\": \"Tab\",\n" diff --git a/src/menu.cc b/src/menu.cc index e4367bd..c1c76a7 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -289,6 +289,23 @@ Menu::Menu() { " " "
" " " + " _Step _Over" + " app.debug_step_over" + +accels["debug_step_over"]+ //For Ubuntu... + " " + " " + " _Step _Into" + " app.debug_step_into" + +accels["debug_step_into"]+ //For Ubuntu... + " " + " " + " _Step _Out" + " app.debug_step_out" + +accels["debug_step_out"]+ //For Ubuntu... + " " + "
" + "
" + " " " _Run Command" " app.debug_run_command" +accels["debug_run_command"]+ //For Ubuntu... diff --git a/src/window.cc b/src/window.cc index 8284e4e..d23a4be 100644 --- a/src/window.cc +++ b/src/window.cc @@ -754,6 +754,27 @@ void Window::set_menu_actions() { Debug::get().kill(); } }); + menu.add_action("debug_step_over", [this]() { + if(debugging) { + auto command_return=Debug::get().run_command("thread step-over"); + Terminal::get().async_print(command_return.first); + Terminal::get().async_print(command_return.second, true); + } + }); + menu.add_action("debug_step_into", [this]() { + if(debugging) { + auto command_return=Debug::get().run_command("thread step-in"); + Terminal::get().async_print(command_return.first); + Terminal::get().async_print(command_return.second, true); + } + }); + menu.add_action("debug_step_out", [this]() { + if(debugging) { + auto command_return=Debug::get().run_command("thread step-out"); + Terminal::get().async_print(command_return.first); + Terminal::get().async_print(command_return.second, true); + } + }); menu.add_action("debug_run_command", [this]() { entry_box.clear(); entry_box.entries.emplace_back(last_run_debug_command, [this](const std::string& content){