summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility/Reproducer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Utility/Reproducer.cpp')
-rw-r--r--lldb/source/Utility/Reproducer.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp
index 8e44f080177..a8a581f0761 100644
--- a/lldb/source/Utility/Reproducer.cpp
+++ b/lldb/source/Utility/Reproducer.cpp
@@ -136,7 +136,15 @@ FileSpec Reproducer::GetReproducerPath() const {
return {};
}
-Generator::Generator(const FileSpec &root) : m_root(root), m_done(false) {}
+static FileSpec MakeAbsolute(FileSpec file_spec) {
+ SmallString<128> path;
+ file_spec.GetPath(path, false);
+ llvm::sys::fs::make_absolute(path);
+ return FileSpec(path, file_spec.GetPathStyle());
+}
+
+Generator::Generator(FileSpec root)
+ : m_root(MakeAbsolute(std::move(root))), m_done(false) {}
Generator::~Generator() {}
@@ -188,7 +196,8 @@ void Generator::AddProvidersToIndex() {
yout << files;
}
-Loader::Loader(const FileSpec &root) : m_root(root), m_loaded(false) {}
+Loader::Loader(FileSpec root)
+ : m_root(MakeAbsolute(std::move(root))), m_loaded(false) {}
llvm::Error Loader::LoadIndex() {
if (m_loaded)
OpenPOWER on IntegriCloud