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/SBValueList.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/SBValueList.cpp')
-rw-r--r-- | lldb/source/API/SBValueList.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/lldb/source/API/SBValueList.cpp b/lldb/source/API/SBValueList.cpp index e3adb445cce..914da817a53 100644 --- a/lldb/source/API/SBValueList.cpp +++ b/lldb/source/API/SBValueList.cpp @@ -11,7 +11,6 @@ #include "lldb/API/SBStream.h" #include "lldb/API/SBValue.h" #include "lldb/Core/ValueObjectList.h" -#include "lldb/Utility/Log.h" #include <vector> @@ -75,30 +74,13 @@ SBValueList::SBValueList() : m_opaque_up() { SBValueList::SBValueList(const SBValueList &rhs) : m_opaque_up() { LLDB_RECORD_CONSTRUCTOR(SBValueList, (const lldb::SBValueList &), rhs); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (rhs.IsValid()) m_opaque_up.reset(new ValueListImpl(*rhs)); - - if (log) { - log->Printf( - "SBValueList::SBValueList (rhs.ap=%p) => this.ap = %p", - static_cast<void *>(rhs.IsValid() ? rhs.m_opaque_up.get() : NULL), - static_cast<void *>(m_opaque_up.get())); - } } SBValueList::SBValueList(const ValueListImpl *lldb_object_ptr) : m_opaque_up() { - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (lldb_object_ptr) m_opaque_up.reset(new ValueListImpl(*lldb_object_ptr)); - - if (log) { - log->Printf("SBValueList::SBValueList (lldb_object_ptr=%p) => this.ap = %p", - static_cast<const void *>(lldb_object_ptr), - static_cast<void *>(m_opaque_up.get())); - } } SBValueList::~SBValueList() {} @@ -167,44 +149,21 @@ SBValue SBValueList::GetValueAtIndex(uint32_t idx) const { LLDB_RECORD_METHOD_CONST(lldb::SBValue, SBValueList, GetValueAtIndex, (uint32_t), idx); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - // if (log) - // log->Printf ("SBValueList::GetValueAtIndex (uint32_t idx) idx = %d", - // idx); SBValue sb_value; if (m_opaque_up) sb_value = m_opaque_up->GetValueAtIndex(idx); - if (log) { - SBStream sstr; - sb_value.GetDescription(sstr); - log->Printf("SBValueList::GetValueAtIndex (this.ap=%p, idx=%d) => SBValue " - "(this.sp = %p, '%s')", - static_cast<void *>(m_opaque_up.get()), idx, - static_cast<void *>(sb_value.GetSP().get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_value); } uint32_t SBValueList::GetSize() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBValueList, GetSize); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - // if (log) - // log->Printf ("SBValueList::GetSize ()"); - uint32_t size = 0; if (m_opaque_up) size = m_opaque_up->GetSize(); - if (log) - log->Printf("SBValueList::GetSize (this.ap=%p) => %d", - static_cast<void *>(m_opaque_up.get()), size); - return size; } |