class Generator final {
public:
- Generator(const FileSpec &root);
+ Generator(FileSpec root);
~Generator();
/// Method to indicate we want to keep the reproducer. If reproducer
class Loader final {
public:
- Loader(const FileSpec &root);
+ Loader(FileSpec root);
template <typename T> FileSpec GetFile() {
if (!HasFile(T::file))
--- /dev/null
+# This tests relative capture paths.
+
+# RUN: mkdir -p %t
+# RUN: cd %t
+# RUN: rm -rf ./foo
+# RUN: %clang %S/Inputs/simple.c -g -o %t/reproducer.out
+# RUN: %lldb -x -b -s %S/Inputs/FileCapture.in -o 'reproducer dump -p files' --capture --capture-path ./foo %t/reproducer.out
+# RUN: %lldb --replay ./foo
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() {}
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)