summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBModule.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-03-07 22:47:13 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-03-07 22:47:13 +0000
commit581af8b09da31fc304f0c297526427c6bca3de14 (patch)
tree184339f41afce1f3f515bd1e2f7f450b7ede191d /lldb/source/API/SBModule.cpp
parentd672e533d5cbd37c7a5f623565ece47167dec411 (diff)
downloadbcm5719-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/SBModule.cpp')
-rw-r--r--lldb/source/API/SBModule.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index ed80449b7cb..2c2670eee1a 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -25,7 +25,6 @@
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
using namespace lldb;
@@ -94,18 +93,11 @@ void SBModule::Clear() {
SBFileSpec SBModule::GetFileSpec() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule, GetFileSpec);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBFileSpec file_spec;
ModuleSP module_sp(GetSP());
if (module_sp)
file_spec.SetFileSpec(module_sp->GetFileSpec());
- if (log)
- log->Printf("SBModule(%p)::GetFileSpec () => SBFileSpec(%p)",
- static_cast<void *>(module_sp.get()),
- static_cast<const void *>(file_spec.get()));
-
return LLDB_RECORD_RESULT(file_spec);
}
@@ -113,18 +105,12 @@ lldb::SBFileSpec SBModule::GetPlatformFileSpec() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule,
GetPlatformFileSpec);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBFileSpec file_spec;
ModuleSP module_sp(GetSP());
if (module_sp)
file_spec.SetFileSpec(module_sp->GetPlatformFileSpec());
- if (log)
- log->Printf("SBModule(%p)::GetPlatformFileSpec () => SBFileSpec(%p)",
- static_cast<void *>(module_sp.get()),
- static_cast<const void *>(file_spec.get()));
-
return LLDB_RECORD_RESULT(file_spec);
}
@@ -133,7 +119,6 @@ bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) {
(const lldb::SBFileSpec &), platform_file);
bool result = false;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ModuleSP module_sp(GetSP());
if (module_sp) {
@@ -141,11 +126,6 @@ bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) {
result = true;
}
- if (log)
- log->Printf("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i",
- static_cast<void *>(module_sp.get()),
- static_cast<const void *>(platform_file.get()),
- platform_file->GetPath().c_str(), result);
return result;
}
@@ -175,30 +155,17 @@ bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) {
const uint8_t *SBModule::GetUUIDBytes() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const uint8_t *, SBModule, GetUUIDBytes);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
const uint8_t *uuid_bytes = NULL;
ModuleSP module_sp(GetSP());
if (module_sp)
uuid_bytes = module_sp->GetUUID().GetBytes().data();
- if (log) {
- if (uuid_bytes) {
- StreamString s;
- module_sp->GetUUID().Dump(&s);
- log->Printf("SBModule(%p)::GetUUIDBytes () => %s",
- static_cast<void *>(module_sp.get()), s.GetData());
- } else
- log->Printf("SBModule(%p)::GetUUIDBytes () => NULL",
- static_cast<void *>(module_sp.get()));
- }
return uuid_bytes;
}
const char *SBModule::GetUUIDString() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBModule, GetUUIDString);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *uuid_cstr = NULL;
ModuleSP module_sp(GetSP());
@@ -211,15 +178,9 @@ const char *SBModule::GetUUIDString() const {
}
if (uuid_cstr && uuid_cstr[0]) {
- if (log)
- log->Printf("SBModule(%p)::GetUUIDString () => %s",
- static_cast<void *>(module_sp.get()), uuid_cstr);
return uuid_cstr;
}
- if (log)
- log->Printf("SBModule(%p)::GetUUIDString () => NULL",
- static_cast<void *>(module_sp.get()));
return NULL;
}
OpenPOWER on IntegriCloud