From dc8dcae1ff7b0319a65ade2ef97f626698ab8cde Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 31 Dec 2015 12:59:32 +0100 Subject: [PATCH] Can now add/remove breakpoints when debug is in running state, also removes stop line mark when debug is in running state --- src/debug.cc | 9 +++++---- src/window.cc | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/debug.cc b/src/debug.cc index 0d8c36a..0a18dbb 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -87,7 +87,9 @@ void Debug::start(std::shared_ptrGetExitStatus(); if(callback) @@ -101,7 +103,6 @@ void Debug::start(std::shared_ptrGetTarget().BreakpointCreateByLocation(file_path.string().c_str(), line_nr)).IsValid()) Terminal::get().async_print("Error (debug): Could not create breakpoint at: "+file_path.string()+":"+std::to_string(line_nr)+'\n', true); } @@ -259,7 +260,7 @@ void Debug::add_breakpoint(const boost::filesystem::path &file_path, int line_nr void Debug::remove_breakpoint(const boost::filesystem::path &file_path, int line_nr, int line_count) { event_mutex.lock(); - if(state==lldb::eStateStopped) { + if(state==lldb::eStateStopped || state==lldb::eStateRunning) { auto target=process->GetTarget(); for(int line_nr_try=line_nr;line_nr_tryget_buffer()->get_insert()->get_iter().get_line(); @@ -781,12 +781,12 @@ void Window::set_menu_actions() { auto end_iter=start_iter; while(!end_iter.ends_line() && end_iter.forward_char()) {} view->get_source_buffer()->remove_source_marks(start_iter, end_iter, "debug_breakpoint"); - if(debug_is_stopped) + if(debug_is_stopped_or_running) Debug::get().remove_breakpoint(view->file_path, line_nr+1, view->get_buffer()->get_line_count()+1); } else { view->get_source_buffer()->create_source_mark("debug_breakpoint", view->get_buffer()->get_insert()->get_iter()); - if(debug_is_stopped) + if(debug_is_stopped_or_running) Debug::get().add_breakpoint(view->file_path, line_nr+1); } }