summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx/objcxx
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-01-29 20:36:38 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-01-29 20:36:38 +0000
commit46575176e9642e9f8567e75e05a98867396803cc (patch)
tree0572584914eb135af50920d5bb3a3faebb7e5911 /lldb/source/Host/macosx/objcxx
parent6159e8693ea182078a509b197373fab2127ecd66 (diff)
downloadbcm5719-llvm-46575176e9642e9f8567e75e05a98867396803cc.tar.gz
bcm5719-llvm-46575176e9642e9f8567e75e05a98867396803cc.zip
[Reproducers] Add file provider
This patch adds the file provider which is responsible for capturing files used by LLDB. When capturing a reproducer, we use a file collector that is very similar to the one used in clang. For every file that we touch, we add an entry with a mapping from its virtual to its real path. When we decide to generate a reproducer we copy over the files and their permission into to reproducer folder. When replaying a reproducer, we load the VFS mapping and instantiate a RedirectingFileSystem. The latter will transparently use the files available in the reproducer. I've tested this on two macOS machines with an artificial example. Still, it is very likely that I missed some places where we (still) use native file system calls. I'm hoping to flesh those out while testing with more advanced examples. However, I will fix those things in separate patches. Differential revision: https://reviews.llvm.org/D54617 llvm-svn: 352538
Diffstat (limited to 'lldb/source/Host/macosx/objcxx')
-rw-r--r--lldb/source/Host/macosx/objcxx/Host.mm15
1 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Host/macosx/objcxx/Host.mm b/lldb/source/Host/macosx/objcxx/Host.mm
index 7b07f6c5340..3ebfc0c53c4 100644
--- a/lldb/source/Host/macosx/objcxx/Host.mm
+++ b/lldb/source/Host/macosx/objcxx/Host.mm
@@ -1299,12 +1299,15 @@ Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
- if (ShouldLaunchUsingXPC(launch_info)) {
- error = LaunchProcessXPC(exe_spec.GetPath().c_str(), launch_info, pid);
- } else {
- error =
- LaunchProcessPosixSpawn(exe_spec.GetPath().c_str(), launch_info, pid);
- }
+ // From now on we'll deal with the external (devirtualized) path.
+ auto exe_path = fs.GetExternalPath(exe_spec);
+ if (!exe_path)
+ return Status(exe_path.getError());
+
+ if (ShouldLaunchUsingXPC(launch_info))
+ error = LaunchProcessXPC(exe_path->c_str(), launch_info, pid);
+ else
+ error = LaunchProcessPosixSpawn(exe_path->c_str(), launch_info, pid);
if (pid != LLDB_INVALID_PROCESS_ID) {
// If all went well, then set the process ID into the launch info
OpenPOWER on IntegriCloud