diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-03-07 22:47:13 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-03-07 22:47:13 +0000 |
commit | 581af8b09da31fc304f0c297526427c6bca3de14 (patch) | |
tree | 184339f41afce1f3f515bd1e2f7f450b7ede191d /lldb/source/API/SBCommandReturnObject.cpp | |
parent | d672e533d5cbd37c7a5f623565ece47167dec411 (diff) | |
download | bcm5719-llvm-581af8b09da31fc304f0c297526427c6bca3de14.tar.gz bcm5719-llvm-581af8b09da31fc304f0c297526427c6bca3de14.zip |
[SBAPI] Log from record macro
The current record macros already log the function being called. This
patch extends the macros to also log their input arguments and removes
explicit logging from the SB API.
This might degrade the amount of information in some cases (because of
smarter casts or efforts to log return values). However I think this is
outweighed by the increased coverage and consistency. Furthermore, using
the reproducer infrastructure, diagnosing bugs in the API layer should
become much easier compared to relying on log messages.
Differential revision: https://reviews.llvm.org/D59101
llvm-svn: 355649
Diffstat (limited to 'lldb/source/API/SBCommandReturnObject.cpp')
-rw-r--r-- | lldb/source/API/SBCommandReturnObject.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp index 62a8c106bba..d28275c6a52 100644 --- a/lldb/source/API/SBCommandReturnObject.cpp +++ b/lldb/source/API/SBCommandReturnObject.cpp @@ -13,7 +13,6 @@ #include "lldb/API/SBStream.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Utility/ConstString.h" -#include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" using namespace lldb; @@ -68,45 +67,25 @@ bool SBCommandReturnObject::IsValid() const { const char *SBCommandReturnObject::GetOutput() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBCommandReturnObject, GetOutput); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (m_opaque_up) { llvm::StringRef output = m_opaque_up->GetOutputData(); ConstString result(output.empty() ? llvm::StringRef("") : output); - if (log) - log->Printf("SBCommandReturnObject(%p)::GetOutput () => \"%s\"", - static_cast<void *>(m_opaque_up.get()), result.AsCString()); - return result.AsCString(); } - if (log) - log->Printf("SBCommandReturnObject(%p)::GetOutput () => nullptr", - static_cast<void *>(m_opaque_up.get())); - return nullptr; } const char *SBCommandReturnObject::GetError() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBCommandReturnObject, GetError); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (m_opaque_up) { llvm::StringRef output = m_opaque_up->GetErrorData(); ConstString result(output.empty() ? llvm::StringRef("") : output); - if (log) - log->Printf("SBCommandReturnObject(%p)::GetError () => \"%s\"", - static_cast<void *>(m_opaque_up.get()), result.AsCString()); - return result.AsCString(); } - if (log) - log->Printf("SBCommandReturnObject(%p)::GetError () => nullptr", - static_cast<void *>(m_opaque_up.get())); - return nullptr; } |