Browse Source

Fixes #382: compilation on MSYS2 with liblldb

merge-requests/382/head
eidheim 8 years ago
parent
commit
ed2f58e076
  1. 18
      src/debug_lldb.cc

18
src/debug_lldb.cc

@ -24,10 +24,15 @@ Debug::LLDB::LLDB(): state(lldb::StateType::eStateInvalid), buffer_size(131072)
setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0); setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0);
#else #else
auto debug_server_path = filesystem::get_executable("lldb-server").string(); 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); setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0);
#endif #endif
} }
#endif
}
} }
std::tuple<std::vector<std::string>, std::string, std::vector<std::string> > Debug::LLDB::parse_run_arguments(const std::string &command) { std::tuple<std::vector<std::string>, std::string, std::vector<std::string> > Debug::LLDB::parse_run_arguments(const std::string &command) {
@ -59,13 +64,8 @@ std::tuple<std::vector<std::string>, std::string, std::vector<std::string> > Deb
break; break;
} }
if(!env_arg) { if(!env_arg)
executable=filesystem::unescape_argument(argument); executable=filesystem::unescape_argument(argument);
#ifdef _WIN32
if(remote_host.empty())
executable+=".exe";
#endif
}
} }
else else
arguments.emplace_back(filesystem::unescape_argument(argument)); 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 parsed_run_arguments=parse_run_arguments(command);
auto &environment_from_arguments=std::get<0>(parsed_run_arguments); auto &environment_from_arguments=std::get<0>(parsed_run_arguments);
auto &executable=std::get<1>(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); auto &arguments=std::get<2>(parsed_run_arguments);
std::vector<const char*> argv; std::vector<const char*> argv;

Loading…
Cancel
Save