From ed2f58e0766bd8117cca53f18dd1ad03ff74407e Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 27 May 2018 17:02:25 +0200 Subject: [PATCH] Fixes #382: compilation on MSYS2 with liblldb --- src/debug_lldb.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/debug_lldb.cc b/src/debug_lldb.cc index 71b1d3c..04a73e4 100644 --- a/src/debug_lldb.cc +++ b/src/debug_lldb.cc @@ -24,8 +24,13 @@ Debug::LLDB::LLDB(): state(lldb::StateType::eStateInvalid), buffer_size(131072) setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0); #else auto debug_server_path = filesystem::get_executable("lldb-server").string(); - if(debug_server_path != "lldb-server") + if(debug_server_path != "lldb-server") { +#ifdef _WIN32 + Glib::setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0); +#else setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0); +#endif + } #endif } } @@ -59,13 +64,8 @@ std::tuple, std::string, std::vector > Deb break; } - if(!env_arg) { + if(!env_arg) executable=filesystem::unescape_argument(argument); -#ifdef _WIN32 - if(remote_host.empty()) - executable+=".exe"; -#endif - } } else arguments.emplace_back(filesystem::unescape_argument(argument)); @@ -100,6 +100,10 @@ void Debug::LLDB::start(const std::string &command, const boost::filesystem::pat auto parsed_run_arguments=parse_run_arguments(command); auto &environment_from_arguments=std::get<0>(parsed_run_arguments); auto &executable=std::get<1>(parsed_run_arguments); +#ifdef _WIN32 + if(remote_host.empty()) + executable+=".exe"; +#endif auto &arguments=std::get<2>(parsed_run_arguments); std::vector argv;