mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
[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
This commit is contained in:
1 parent
d672e533d5
commit
581af8b09d
39 files changed
+124
-3032
No files matched your search
@@ -18,7 +18,6 @@
|
||||
#include "lldb/Symbol/VariableList.h"
|
||||
#include "lldb/Target/ExecutionContext.h"
|
||||
#include "lldb/Target/Target.h"
|
||||
#include "lldb/Utility/Log.h"
|
||||
|
||||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
@@ -58,15 +57,6 @@ const char *SBFunction::GetName() const {
|
||||
if (m_opaque_ptr)
|
||||
cstr = m_opaque_ptr->GetName().AsCString();
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
if (log) {
|
||||
if (cstr)
|
||||
log->Printf("SBFunction(%p)::GetName () => \"%s\"",
|
||||
static_cast<void *>(m_opaque_ptr), cstr);
|
||||
else
|
||||
log->Printf("SBFunction(%p)::GetName () => NULL",
|
||||
static_cast<void *>(m_opaque_ptr));
|
||||
}
|
||||
return cstr;
|
||||
}
|
||||
|
||||
@@ -79,15 +69,6 @@ const char *SBFunction::GetDisplayName() const {
|
||||
.GetDisplayDemangledName(m_opaque_ptr->GetLanguage())
|
||||
.AsCString();
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
if (log) {
|
||||
if (cstr)
|
||||
log->Printf("SBFunction(%p)::GetDisplayName () => \"%s\"",
|
||||
static_cast<void *>(m_opaque_ptr), cstr);
|
||||
else
|
||||
log->Printf("SBFunction(%p)::GetDisplayName () => NULL",
|
||||
static_cast<void *>(m_opaque_ptr));
|
||||
}
|
||||
return cstr;
|
||||
}
|
||||
|
||||
@@ -97,15 +78,6 @@ const char *SBFunction::GetMangledName() const {
|
||||
const char *cstr = NULL;
|
||||
if (m_opaque_ptr)
|
||||
cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
if (log) {
|
||||
if (cstr)
|
||||
log->Printf("SBFunction(%p)::GetMangledName () => \"%s\"",
|
||||
static_cast<void *>(m_opaque_ptr), cstr);
|
||||
else
|
||||
log->Printf("SBFunction(%p)::GetMangledName () => NULL",
|
||||
static_cast<void *>(m_opaque_ptr));
|
||||
}
|
||||
return cstr;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user