From 2289fa48209997bbda285c8ba2f25fa0f4eac39f Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 30 Apr 2011 01:09:13 +0000 Subject: Added the ability to set the Platform path for a module through the SBModule interface. Added a quick way to set the platform though the SBDebugger interface. I will actually an a SBPlatform support soon, but for now this will do. ConnectionFileDescriptor can be passed a url formatted as: "fd://" where is a file descriptor in the current process. This is handy if you have services, deamons, or other tools that can spawn processes and give you a file handle. llvm-svn: 130565 --- lldb/source/Target/Process.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lldb/source/Target/Process.cpp') diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 5ad5ac22445c..8e96c716e74f 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -2065,8 +2065,10 @@ Process::Launch Module *exe_module = m_target.GetExecutableModule().get(); if (exe_module) { - char exec_file_path[PATH_MAX]; - exe_module->GetFileSpec().GetPath(exec_file_path, sizeof(exec_file_path)); + char local_exec_file_path[PATH_MAX]; + char platform_exec_file_path[PATH_MAX]; + exe_module->GetFileSpec().GetPath(local_exec_file_path, sizeof(local_exec_file_path)); + exe_module->GetPlatformFileSpec().GetPath(platform_exec_file_path, sizeof(platform_exec_file_path)); if (exe_module->GetFileSpec().Exists()) { if (PrivateStateThreadIsValid ()) @@ -2089,7 +2091,7 @@ Process::Launch // Make a new argument vector std::vector exec_path_plus_argv; // Append the resolved executable path - exec_path_plus_argv.push_back (exec_file_path); + exec_path_plus_argv.push_back (platform_exec_file_path); // Push all args if there are any if (argv) @@ -2156,7 +2158,7 @@ Process::Launch } else { - error.SetErrorStringWithFormat("File doesn't exist: '%s'.\n", exec_file_path); + error.SetErrorStringWithFormat("File doesn't exist: '%s'.\n", local_exec_file_path); } } return error; -- cgit v1.2.3