summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/API/SBDebugger.cpp6
-rw-r--r--lldb/source/Host/common/FileSystem.cpp5
-rw-r--r--lldb/source/Utility/FileCollector.cpp7
3 files changed, 14 insertions, 4 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 7af83324e9f..634c4a92959 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -82,6 +82,12 @@ public:
if (auto err = yin.error())
return {};
+ for (auto &file : files) {
+ FileSpec absolute_path =
+ loader->GetRoot().CopyByAppendingPathComponent(file);
+ file = absolute_path.GetPath();
+ }
+
return llvm::make_unique<CommandLoader>(std::move(files));
}
diff --git a/lldb/source/Host/common/FileSystem.cpp b/lldb/source/Host/common/FileSystem.cpp
index ade7cc95bd7..d5ac05bd447 100644
--- a/lldb/source/Host/common/FileSystem.cpp
+++ b/lldb/source/Host/common/FileSystem.cpp
@@ -63,8 +63,9 @@ llvm::Error FileSystem::Initialize(const FileSpec &mapping) {
if (!buffer)
return llvm::errorCodeToError(buffer.getError());
- InstanceImpl().emplace(
- llvm::vfs::getVFSFromYAML(std::move(buffer.get()), nullptr, ""), true);
+ InstanceImpl().emplace(llvm::vfs::getVFSFromYAML(std::move(buffer.get()),
+ nullptr, mapping.GetPath()),
+ true);
return llvm::Error::success();
}
diff --git a/lldb/source/Utility/FileCollector.cpp b/lldb/source/Utility/FileCollector.cpp
index 1758ad8c82c..566355d4973 100644
--- a/lldb/source/Utility/FileCollector.cpp
+++ b/lldb/source/Utility/FileCollector.cpp
@@ -33,7 +33,8 @@ static bool IsCaseSensitivePath(StringRef path) {
return true;
}
-FileCollector::FileCollector(const FileSpec &root) : m_root(root) {
+FileCollector::FileCollector(const FileSpec &root, const FileSpec &overlay_root)
+ : m_root(root), m_overlay_root(overlay_root) {
sys::fs::create_directories(m_root.GetPath(), true);
}
@@ -133,7 +134,9 @@ std::error_code FileCollector::CopyFiles(bool stop_on_error) {
std::error_code FileCollector::WriteMapping(const FileSpec &mapping_file) {
std::lock_guard<std::mutex> lock(m_mutex);
- const std::string root = m_root.GetPath();
+ llvm::StringRef root = m_overlay_root.GetPath();
+
+ m_vfs_writer.setOverlayDir(root);
m_vfs_writer.setCaseSensitivity(IsCaseSensitivePath(root));
m_vfs_writer.setUseExternalNames(false);
OpenPOWER on IntegriCloud