mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 21:55:39 +08:00
Clean up the API logging code:
- Try to reduce logging to one line per function call instead of tw
- Put all arguments & their values into log for calls
- Add 'this' parameter information to function call logging, making it show the appropriate
internal pointer (this.obj, this.sp, this.ap...)
- Clean up some return values
- Remove logging of constructors that construct empty objects
- Change '==>' to '=>' for showing result values...
- Fix various minor bugs
- Add some protected 'get' functions to help getting the internal pointers for the 'this' arguments...
llvm-svn: 117417
This commit is contained in:
@@ -22,23 +22,20 @@ using namespace lldb_private;
|
||||
SBSymbol::SBSymbol () :
|
||||
m_opaque_ptr (NULL)
|
||||
{
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
|
||||
|
||||
if (log)
|
||||
log->Printf ("SBSymbol::SBSymbol () ==> this = %p", this);
|
||||
}
|
||||
|
||||
SBSymbol::SBSymbol (lldb_private::Symbol *lldb_object_ptr) :
|
||||
m_opaque_ptr (lldb_object_ptr)
|
||||
{
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
|
||||
|
||||
if (log)
|
||||
{
|
||||
SBStream sstr;
|
||||
GetDescription (sstr);
|
||||
log->Printf ("SBSymbol::SBSymbol (lldb_private::Symbol *lldb_object_ptr) lldb_object_ptr = %p ==> "
|
||||
"this = %p (%s)", lldb_object_ptr, this, sstr.GetData());
|
||||
log->Printf ("SBSymbol::SBSymbol (lldb_object_ptr=%p) => this.obj = %p (%s)", lldb_object_ptr, m_opaque_ptr,
|
||||
sstr.GetData());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,18 +55,20 @@ SBSymbol::GetName() const
|
||||
{
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
|
||||
|
||||
if (log)
|
||||
log->Printf ("SBSymbol::GetName ()");
|
||||
//if (log)
|
||||
// log->Printf ("SBSymbol::GetName ()");
|
||||
|
||||
if (m_opaque_ptr)
|
||||
{
|
||||
if (log)
|
||||
log->Printf ("SBSymbol::GetName ==> %s", m_opaque_ptr->GetMangled().GetName().AsCString());
|
||||
log->Printf ("SBSymbol::GetName (this.obj=%p) => '%s'", m_opaque_ptr,
|
||||
m_opaque_ptr->GetMangled().GetName().AsCString());
|
||||
|
||||
return m_opaque_ptr->GetMangled().GetName().AsCString();
|
||||
}
|
||||
|
||||
if (log)
|
||||
log->Printf ("SBSymbol::GetName ==> NULL");
|
||||
log->Printf ("SBSymbol::GetName (this.obj=%p) => NULL", m_opaque_ptr);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -136,3 +135,8 @@ SBSymbol::GetInstructions (SBTarget target)
|
||||
return sb_instructions;
|
||||
}
|
||||
|
||||
lldb_private::Symbol *
|
||||
SBSymbol::get ()
|
||||
{
|
||||
return m_opaque_ptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user