Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit ed2f58e

Browse files
committed
Fixes #382: compilation on MSYS2 with liblldb
1 parent f2ef7ed commit ed2f58e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/debug_lldb.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ Debug::LLDB::LLDB(): state(lldb::StateType::eStateInvalid), buffer_size(131072)
2424
setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0);
2525
#else
2626
auto debug_server_path = filesystem::get_executable("lldb-server").string();
27-
if(debug_server_path != "lldb-server")
27+
if(debug_server_path != "lldb-server") {
28+
#ifdef _WIN32
29+
Glib::setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0);
30+
#else
2831
setenv("LLDB_DEBUGSERVER_PATH", debug_server_path.c_str(), 0);
32+
#endif
33+
}
2934
#endif
3035
}
3136
}
@@ -59,13 +64,8 @@ std::tuple<std::vector<std::string>, std::string, std::vector<std::string> > Deb
5964
break;
6065
}
6166

62-
if(!env_arg) {
67+
if(!env_arg)
6368
executable=filesystem::unescape_argument(argument);
64-
#ifdef _WIN32
65-
if(remote_host.empty())
66-
executable+=".exe";
67-
#endif
68-
}
6969
}
7070
else
7171
arguments.emplace_back(filesystem::unescape_argument(argument));
@@ -100,6 +100,10 @@ void Debug::LLDB::start(const std::string &command, const boost::filesystem::pat
100100
auto parsed_run_arguments=parse_run_arguments(command);
101101
auto &environment_from_arguments=std::get<0>(parsed_run_arguments);
102102
auto &executable=std::get<1>(parsed_run_arguments);
103+
#ifdef _WIN32
104+
if(remote_host.empty())
105+
executable+=".exe";
106+
#endif
103107
auto &arguments=std::get<2>(parsed_run_arguments);
104108

105109
std::vector<const char*> argv;

0 commit comments

Comments
 (0)