From 32c11e64cb984e00a40ead2fad53f7a39ff5e924 Mon Sep 17 00:00:00 2001 From: milleniumbug Date: Fri, 6 May 2016 19:26:35 +0200 Subject: [PATCH 1/2] fixed issue with removing breakpoints Fixes #212 --- src/debug_clang.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/debug_clang.cc b/src/debug_clang.cc index 9e398bd..f3a3108 100644 --- a/src/debug_clang.cc +++ b/src/debug_clang.cc @@ -463,6 +463,7 @@ void Debug::Clang::remove_breakpoint(const boost::filesystem::path &file_path, i auto file_spec=line_entry.GetFileSpec(); boost::filesystem::path breakpoint_path=file_spec.GetDirectory(); breakpoint_path/=file_spec.GetFilename(); + breakpoint_path = boost::filesystem::canonical(breakpoint_path); if(breakpoint_path==file_path) { if(!target.BreakpointDelete(breakpoint.GetID())) Terminal::get().async_print("Error (debug): Could not delete breakpoint at: "+file_path.string()+":"+std::to_string(line_nr)+'\n', true); From b2be83e9d03d1b8f1e18f9ce5b7d97f196b3b25a Mon Sep 17 00:00:00 2001 From: milleniumbug Date: Fri, 6 May 2016 19:54:23 +0200 Subject: [PATCH 2/2] Don't throw an exception on canonicalize --- src/debug_clang.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/debug_clang.cc b/src/debug_clang.cc index f3a3108..2885ef6 100644 --- a/src/debug_clang.cc +++ b/src/debug_clang.cc @@ -463,9 +463,10 @@ void Debug::Clang::remove_breakpoint(const boost::filesystem::path &file_path, i auto file_spec=line_entry.GetFileSpec(); boost::filesystem::path breakpoint_path=file_spec.GetDirectory(); breakpoint_path/=file_spec.GetFilename(); - breakpoint_path = boost::filesystem::canonical(breakpoint_path); + boost::system::error_code ec; + breakpoint_path = boost::filesystem::canonical(breakpoint_path, ec); if(breakpoint_path==file_path) { - if(!target.BreakpointDelete(breakpoint.GetID())) + if(!ec || !target.BreakpointDelete(breakpoint.GetID())) Terminal::get().async_print("Error (debug): Could not delete breakpoint at: "+file_path.string()+":"+std::to_string(line_nr)+'\n', true); return; }