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/SBLineEntry.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/SBLineEntry.cpp')
-rw-r--r-- | lldb/source/API/SBLineEntry.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lldb/source/API/SBLineEntry.cpp b/lldb/source/API/SBLineEntry.cpp index 6b124128433..e0c0a5c7bd9 100644 --- a/lldb/source/API/SBLineEntry.cpp +++ b/lldb/source/API/SBLineEntry.cpp @@ -12,7 +12,6 @@ #include "lldb/API/SBStream.h" #include "lldb/Host/PosixApi.h" #include "lldb/Symbol/LineEntry.h" -#include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" #include <limits.h> @@ -59,18 +58,6 @@ SBAddress SBLineEntry::GetStartAddress() const { if (m_opaque_up) sb_address.SetAddress(&m_opaque_up->range.GetBaseAddress()); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) { - StreamString sstr; - const Address *addr = sb_address.get(); - if (addr) - addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress, - Address::DumpStyleInvalid, 4); - log->Printf("SBLineEntry(%p)::GetStartAddress () => SBAddress (%p): %s", - static_cast<void *>(m_opaque_up.get()), - static_cast<void *>(sb_address.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_address); } @@ -82,17 +69,6 @@ SBAddress SBLineEntry::GetEndAddress() const { sb_address.SetAddress(&m_opaque_up->range.GetBaseAddress()); sb_address.OffsetAddress(m_opaque_up->range.GetByteSize()); } - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) { - StreamString sstr; - const Address *addr = sb_address.get(); - if (addr) - addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress, - Address::DumpStyleInvalid, 4); - log->Printf("SBLineEntry(%p)::GetEndAddress () => SBAddress (%p): %s", - static_cast<void *>(m_opaque_up.get()), - static_cast<void *>(sb_address.get()), sstr.GetData()); - } return LLDB_RECORD_RESULT(sb_address); } @@ -105,36 +81,20 @@ bool SBLineEntry::IsValid() const { SBFileSpec SBLineEntry::GetFileSpec() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBLineEntry, GetFileSpec); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - SBFileSpec sb_file_spec; if (m_opaque_up.get() && m_opaque_up->file) sb_file_spec.SetFileSpec(m_opaque_up->file); - if (log) { - SBStream sstr; - sb_file_spec.GetDescription(sstr); - log->Printf("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s", - static_cast<void *>(m_opaque_up.get()), - static_cast<const void *>(sb_file_spec.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_file_spec); } uint32_t SBLineEntry::GetLine() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBLineEntry, GetLine); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - uint32_t line = 0; if (m_opaque_up) line = m_opaque_up->line; - if (log) - log->Printf("SBLineEntry(%p)::GetLine () => %u", - static_cast<void *>(m_opaque_up.get()), line); - return line; } |