diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-20 15:00:15 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-20 15:00:15 +0000 |
| commit | 763d4102c9736544f95a61d4d0a9a5be8c5a5df1 (patch) | |
| tree | b4a2965a49e80461fb52cd69d55f966058e7ef4d /contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp | |
| parent | 0e23b2ff8c430cd1145afb7bd55917c326bb1d06 (diff) | |
| parent | 94994d372d014ce4c8758b9605d63fae651bd8aa (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp')
| -rw-r--r-- | contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp b/contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp index 011b88225ef9..f136409d0b68 100644 --- a/contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp +++ b/contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// -#include <inttypes.h> // PRIu64 +#include <inttypes.h> #include <limits.h> #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBStream.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/PosixApi.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" @@ -31,11 +32,15 @@ SBFileSpec::SBFileSpec(const lldb_private::FileSpec &fspec) : m_opaque_ap(new lldb_private::FileSpec(fspec)) {} // Deprecated!!! -SBFileSpec::SBFileSpec(const char *path) - : m_opaque_ap(new FileSpec(path, true)) {} +SBFileSpec::SBFileSpec(const char *path) : m_opaque_ap(new FileSpec(path)) { + FileSystem::Instance().Resolve(*m_opaque_ap); +} SBFileSpec::SBFileSpec(const char *path, bool resolve) - : m_opaque_ap(new FileSpec(path, resolve)) {} + : m_opaque_ap(new FileSpec(path)) { + if (resolve) + FileSystem::Instance().Resolve(*m_opaque_ap); +} SBFileSpec::~SBFileSpec() {} @@ -50,7 +55,7 @@ bool SBFileSpec::IsValid() const { return m_opaque_ap->operator bool(); } bool SBFileSpec::Exists() const { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - bool result = m_opaque_ap->Exists(); + bool result = FileSystem::Instance().Exists(*m_opaque_ap); if (log) log->Printf("SBFileSpec(%p)::Exists () => %s", @@ -61,13 +66,13 @@ bool SBFileSpec::Exists() const { } bool SBFileSpec::ResolveExecutableLocation() { - return m_opaque_ap->ResolveExecutableLocation(); + return FileSystem::Instance().ResolveExecutableLocation(*m_opaque_ap); } int SBFileSpec::ResolvePath(const char *src_path, char *dst_path, size_t dst_len) { llvm::SmallString<64> result(src_path); - lldb_private::FileSpec::Resolve(result); + FileSystem::Instance().Resolve(result); ::snprintf(dst_path, dst_len, "%s", result.c_str()); return std::min(dst_len - 1, result.size()); } @@ -143,12 +148,10 @@ const lldb_private::FileSpec *SBFileSpec::get() const { } const lldb_private::FileSpec &SBFileSpec::operator*() const { - return *m_opaque_ap.get(); + return *m_opaque_ap; } -const lldb_private::FileSpec &SBFileSpec::ref() const { - return *m_opaque_ap.get(); -} +const lldb_private::FileSpec &SBFileSpec::ref() const { return *m_opaque_ap; } void SBFileSpec::SetFileSpec(const lldb_private::FileSpec &fs) { *m_opaque_ap = fs; |
