31
31
#include " Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
32
32
#include " lldb/Host/ConnectionFileDescriptor.h"
33
33
#include " lldb/Host/HostGetOpt.h"
34
+ #include " lldb/Host/HostInfo.h"
34
35
#include " lldb/Host/MainLoop.h"
35
36
#include " lldb/Host/OptionParser.h"
36
37
#include " lldb/Host/Socket.h"
@@ -256,7 +257,7 @@ static void client_handle(GDBRemoteCommunicationServerPlatform &platform,
256
257
printf (" Disconnected.\n " );
257
258
}
258
259
259
- static Status spawn_process (const char *progname , const Socket *conn_socket,
260
+ static Status spawn_process (const FileSpec &prog , const Socket *conn_socket,
260
261
uint16_t gdb_port, const lldb_private::Args &args,
261
262
const std::string &log_file,
262
263
const StringRef log_channels, MainLoop &main_loop) {
@@ -267,8 +268,7 @@ static Status spawn_process(const char *progname, const Socket *conn_socket,
267
268
268
269
ProcessLaunchInfo launch_info;
269
270
270
- FileSpec self_spec (progname, FileSpec::Style ::native);
271
- launch_info.SetExecutableFile (self_spec, true );
271
+ launch_info.SetExecutableFile (prog, true );
272
272
Args &self_args = launch_info.GetArguments ();
273
273
self_args.AppendArgument (llvm::StringRef (" platform" ));
274
274
self_args.AppendArgument (llvm::StringRef (" --child-platform-fd" ));
@@ -547,11 +547,11 @@ int main_platform(int argc, char *argv[]) {
547
547
{
548
548
llvm::Expected<std::vector<MainLoopBase::ReadHandleUP>> platform_handles =
549
549
platform_sock->Accept (
550
- main_loop, [progname, gdbserver_port, &inferior_arguments, log_file,
550
+ main_loop, [gdbserver_port, &inferior_arguments, log_file,
551
551
log_channels, &main_loop,
552
552
&platform_handles](std::unique_ptr<Socket> sock_up) {
553
553
printf (" Connection established.\n " );
554
- Status error = spawn_process (progname , sock_up.get (),
554
+ Status error = spawn_process (HostInfo::GetProgramFileSpec () , sock_up.get (),
555
555
gdbserver_port, inferior_arguments,
556
556
log_file, log_channels, main_loop);
557
557
if (error.Fail ()) {
0 commit comments