summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBError.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBError.cpp')
-rw-r--r--lldb/source/API/SBError.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/lldb/source/API/SBError.cpp b/lldb/source/API/SBError.cpp
index 1b026f0c4b9..d60fa361b4f 100644
--- a/lldb/source/API/SBError.cpp
+++ b/lldb/source/API/SBError.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "lldb/API/SBError.h"
+#include "SBReproducerPrivate.h"
#include "Utils.h"
#include "lldb/API/SBStream.h"
#include "lldb/Utility/Log.h"
@@ -17,32 +18,43 @@
using namespace lldb;
using namespace lldb_private;
-SBError::SBError() : m_opaque_up() {}
+SBError::SBError() : m_opaque_up() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBError); }
SBError::SBError(const SBError &rhs) : m_opaque_up() {
+ LLDB_RECORD_CONSTRUCTOR(SBError, (const lldb::SBError &), rhs);
+
m_opaque_up = clone(rhs.m_opaque_up);
}
SBError::~SBError() {}
const SBError &SBError::operator=(const SBError &rhs) {
+ LLDB_RECORD_METHOD(const lldb::SBError &,
+ SBError, operator=,(const lldb::SBError &), rhs);
+
if (this != &rhs)
m_opaque_up = clone(rhs.m_opaque_up);
return *this;
}
const char *SBError::GetCString() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBError, GetCString);
+
if (m_opaque_up)
return m_opaque_up->AsCString();
return NULL;
}
void SBError::Clear() {
+ LLDB_RECORD_METHOD_NO_ARGS(void, SBError, Clear);
+
if (m_opaque_up)
m_opaque_up->Clear();
}
bool SBError::Fail() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBError, Fail);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_value = false;
@@ -57,6 +69,8 @@ bool SBError::Fail() const {
}
bool SBError::Success() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBError, Success);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_value = true;
if (m_opaque_up)
@@ -70,6 +84,8 @@ bool SBError::Success() const {
}
uint32_t SBError::GetError() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBError, GetError);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t err = 0;
@@ -84,6 +100,8 @@ uint32_t SBError::GetError() const {
}
ErrorType SBError::GetType() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::ErrorType, SBError, GetType);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ErrorType err_type = eErrorTypeInvalid;
if (m_opaque_up)
@@ -97,6 +115,9 @@ ErrorType SBError::GetType() const {
}
void SBError::SetError(uint32_t err, ErrorType type) {
+ LLDB_RECORD_METHOD(void, SBError, SetError, (uint32_t, lldb::ErrorType), err,
+ type);
+
CreateIfNeeded();
m_opaque_up->SetError(err, type);
}
@@ -107,16 +128,22 @@ void SBError::SetError(const Status &lldb_error) {
}
void SBError::SetErrorToErrno() {
+ LLDB_RECORD_METHOD_NO_ARGS(void, SBError, SetErrorToErrno);
+
CreateIfNeeded();
m_opaque_up->SetErrorToErrno();
}
void SBError::SetErrorToGenericError() {
+ LLDB_RECORD_METHOD_NO_ARGS(void, SBError, SetErrorToGenericError);
+
CreateIfNeeded();
m_opaque_up->SetErrorToErrno();
}
void SBError::SetErrorString(const char *err_str) {
+ LLDB_RECORD_METHOD(void, SBError, SetErrorString, (const char *), err_str);
+
CreateIfNeeded();
m_opaque_up->SetErrorString(err_str);
}
@@ -130,7 +157,11 @@ int SBError::SetErrorStringWithFormat(const char *format, ...) {
return num_chars;
}
-bool SBError::IsValid() const { return m_opaque_up != NULL; }
+bool SBError::IsValid() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBError, IsValid);
+
+ return m_opaque_up != NULL;
+}
void SBError::CreateIfNeeded() {
if (m_opaque_up == NULL)
@@ -152,6 +183,9 @@ const lldb_private::Status &SBError::operator*() const {
}
bool SBError::GetDescription(SBStream &description) {
+ LLDB_RECORD_METHOD(bool, SBError, GetDescription, (lldb::SBStream &),
+ description);
+
if (m_opaque_up) {
if (m_opaque_up->Success())
description.Printf("success");
OpenPOWER on IntegriCloud