aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBFileSpec.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-01-27 22:06:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-01-27 22:06:42 +0000
commit6f8fc217eaa12bf657be1c6468ed9938d10168b3 (patch)
treea1fd89b864d9b93e2ad68fe1dcf7afee2e3c8d76 /lldb/source/API/SBFileSpec.cpp
parent77fc4c146f0870ffb09c1afb823ccbe742c5e6ff (diff)
Diffstat (limited to 'lldb/source/API/SBFileSpec.cpp')
-rw-r--r--lldb/source/API/SBFileSpec.cpp85
1 files changed, 22 insertions, 63 deletions
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp
index 0a6b63bb460c..2bec9a7a1e77 100644
--- a/lldb/source/API/SBFileSpec.cpp
+++ b/lldb/source/API/SBFileSpec.cpp
@@ -7,12 +7,12 @@
//===----------------------------------------------------------------------===//
#include "lldb/API/SBFileSpec.h"
-#include "SBReproducerPrivate.h"
#include "Utils.h"
#include "lldb/API/SBStream.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/Instrumentation.h"
#include "lldb/Utility/Stream.h"
#include "llvm/ADT/SmallString.h"
@@ -24,11 +24,11 @@ using namespace lldb;
using namespace lldb_private;
SBFileSpec::SBFileSpec() : m_opaque_up(new lldb_private::FileSpec()) {
- LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFileSpec);
+ LLDB_INSTRUMENT_VA(this);
}
-SBFileSpec::SBFileSpec(const SBFileSpec &rhs) : m_opaque_up() {
- LLDB_RECORD_CONSTRUCTOR(SBFileSpec, (const lldb::SBFileSpec &), rhs);
+SBFileSpec::SBFileSpec(const SBFileSpec &rhs) {
+ LLDB_INSTRUMENT_VA(this, rhs);
m_opaque_up = clone(rhs.m_opaque_up);
}
@@ -38,14 +38,14 @@ SBFileSpec::SBFileSpec(const lldb_private::FileSpec &fspec)
// Deprecated!!!
SBFileSpec::SBFileSpec(const char *path) : m_opaque_up(new FileSpec(path)) {
- LLDB_RECORD_CONSTRUCTOR(SBFileSpec, (const char *), path);
+ LLDB_INSTRUMENT_VA(this, path);
FileSystem::Instance().Resolve(*m_opaque_up);
}
SBFileSpec::SBFileSpec(const char *path, bool resolve)
: m_opaque_up(new FileSpec(path)) {
- LLDB_RECORD_CONSTRUCTOR(SBFileSpec, (const char *, bool), path, resolve);
+ LLDB_INSTRUMENT_VA(this, path, resolve);
if (resolve)
FileSystem::Instance().Resolve(*m_opaque_up);
@@ -54,55 +54,50 @@ SBFileSpec::SBFileSpec(const char *path, bool resolve)
SBFileSpec::~SBFileSpec() = default;
const SBFileSpec &SBFileSpec::operator=(const SBFileSpec &rhs) {
- LLDB_RECORD_METHOD(const lldb::SBFileSpec &,
- SBFileSpec, operator=,(const lldb::SBFileSpec &), rhs);
+ LLDB_INSTRUMENT_VA(this, rhs);
if (this != &rhs)
m_opaque_up = clone(rhs.m_opaque_up);
- return LLDB_RECORD_RESULT(*this);
+ return *this;
}
bool SBFileSpec::operator==(const SBFileSpec &rhs) const {
- LLDB_RECORD_METHOD_CONST(bool, SBFileSpec, operator==,(const SBFileSpec &rhs),
- rhs);
+ LLDB_INSTRUMENT_VA(this, rhs);
return ref() == rhs.ref();
}
bool SBFileSpec::operator!=(const SBFileSpec &rhs) const {
- LLDB_RECORD_METHOD_CONST(bool, SBFileSpec, operator!=,(const SBFileSpec &rhs),
- rhs);
+ LLDB_INSTRUMENT_VA(this, rhs);
return !(*this == rhs);
}
bool SBFileSpec::IsValid() const {
- LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFileSpec, IsValid);
+ LLDB_INSTRUMENT_VA(this);
return this->operator bool();
}
SBFileSpec::operator bool() const {
- LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFileSpec, operator bool);
+ LLDB_INSTRUMENT_VA(this);
return m_opaque_up->operator bool();
}
bool SBFileSpec::Exists() const {
- LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFileSpec, Exists);
+ LLDB_INSTRUMENT_VA(this);
return FileSystem::Instance().Exists(*m_opaque_up);
}
bool SBFileSpec::ResolveExecutableLocation() {
- LLDB_RECORD_METHOD_NO_ARGS(bool, SBFileSpec, ResolveExecutableLocation);
+ LLDB_INSTRUMENT_VA(this);
return FileSystem::Instance().ResolveExecutableLocation(*m_opaque_up);
}
int SBFileSpec::ResolvePath(const char *src_path, char *dst_path,
size_t dst_len) {
- LLDB_RECORD_STATIC_METHOD(int, SBFileSpec, ResolvePath,
- (const char *, char *, size_t), src_path, dst_path,
- dst_len);
+ LLDB_INSTRUMENT_VA(src_path, dst_path, dst_len);
llvm::SmallString<64> result(src_path);
FileSystem::Instance().Resolve(result);
@@ -111,13 +106,13 @@ int SBFileSpec::ResolvePath(const char *src_path, char *dst_path,
}
const char *SBFileSpec::GetFilename() const {
- LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFileSpec, GetFilename);
+ LLDB_INSTRUMENT_VA(this);
return m_opaque_up->GetFilename().AsCString();
}
const char *SBFileSpec::GetDirectory() const {
- LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFileSpec, GetDirectory);
+ LLDB_INSTRUMENT_VA(this);
FileSpec directory{*m_opaque_up};
directory.GetFilename().Clear();
@@ -125,7 +120,7 @@ const char *SBFileSpec::GetDirectory() const {
}
void SBFileSpec::SetFilename(const char *filename) {
- LLDB_RECORD_METHOD(void, SBFileSpec, SetFilename, (const char *), filename);
+ LLDB_INSTRUMENT_VA(this, filename);
if (filename && filename[0])
m_opaque_up->GetFilename().SetCString(filename);
@@ -134,7 +129,7 @@ void SBFileSpec::SetFilename(const char *filename) {
}
void SBFileSpec::SetDirectory(const char *directory) {
- LLDB_RECORD_METHOD(void, SBFileSpec, SetDirectory, (const char *), directory);
+ LLDB_INSTRUMENT_VA(this, directory);
if (directory && directory[0])
m_opaque_up->GetDirectory().SetCString(directory);
@@ -143,8 +138,7 @@ void SBFileSpec::SetDirectory(const char *directory) {
}
uint32_t SBFileSpec::GetPath(char *dst_path, size_t dst_len) const {
- LLDB_RECORD_CHAR_PTR_METHOD_CONST(uint32_t, SBFileSpec, GetPath,
- (char *, size_t), dst_path, "", dst_len);
+ LLDB_INSTRUMENT_VA(this, dst_path, dst_len);
uint32_t result = m_opaque_up->GetPath(dst_path, dst_len);
@@ -172,8 +166,7 @@ void SBFileSpec::SetFileSpec(const lldb_private::FileSpec &fs) {
}
bool SBFileSpec::GetDescription(SBStream &description) const {
- LLDB_RECORD_METHOD_CONST(bool, SBFileSpec, GetDescription, (lldb::SBStream &),
- description);
+ LLDB_INSTRUMENT_VA(this, description);
Stream &strm = description.ref();
char path[PATH_MAX];
@@ -183,41 +176,7 @@ bool SBFileSpec::GetDescription(SBStream &description) const {
}
void SBFileSpec::AppendPathComponent(const char *fn) {
- LLDB_RECORD_METHOD(void, SBFileSpec, AppendPathComponent, (const char *), fn);
+ LLDB_INSTRUMENT_VA(this, fn);
m_opaque_up->AppendPathComponent(fn);
}
-
-namespace lldb_private {
-namespace repro {
-
-template <>
-void RegisterMethods<SBFileSpec>(Registry &R) {
- LLDB_REGISTER_CONSTRUCTOR(SBFileSpec, ());
- LLDB_REGISTER_CONSTRUCTOR(SBFileSpec, (const lldb::SBFileSpec &));
- LLDB_REGISTER_CONSTRUCTOR(SBFileSpec, (const char *));
- LLDB_REGISTER_CONSTRUCTOR(SBFileSpec, (const char *, bool));
- LLDB_REGISTER_METHOD(const lldb::SBFileSpec &,
- SBFileSpec, operator=,(const lldb::SBFileSpec &));
- LLDB_REGISTER_METHOD_CONST(bool,
- SBFileSpec, operator==,(const lldb::SBFileSpec &));
- LLDB_REGISTER_METHOD_CONST(bool,
- SBFileSpec, operator!=,(const lldb::SBFileSpec &));
- LLDB_REGISTER_METHOD_CONST(bool, SBFileSpec, IsValid, ());
- LLDB_REGISTER_METHOD_CONST(bool, SBFileSpec, operator bool, ());
- LLDB_REGISTER_METHOD_CONST(bool, SBFileSpec, Exists, ());
- LLDB_REGISTER_METHOD(bool, SBFileSpec, ResolveExecutableLocation, ());
- LLDB_REGISTER_STATIC_METHOD(int, SBFileSpec, ResolvePath,
- (const char *, char *, size_t));
- LLDB_REGISTER_METHOD_CONST(const char *, SBFileSpec, GetFilename, ());
- LLDB_REGISTER_METHOD_CONST(const char *, SBFileSpec, GetDirectory, ());
- LLDB_REGISTER_METHOD(void, SBFileSpec, SetFilename, (const char *));
- LLDB_REGISTER_METHOD(void, SBFileSpec, SetDirectory, (const char *));
- LLDB_REGISTER_METHOD_CONST(bool, SBFileSpec, GetDescription,
- (lldb::SBStream &));
- LLDB_REGISTER_METHOD(void, SBFileSpec, AppendPathComponent, (const char *));
- LLDB_REGISTER_CHAR_PTR_METHOD_CONST(uint32_t, SBFileSpec, GetPath);
-}
-
-}
-}