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:
Caroline Tice
2010-10-26 23:49:36 +00:00
parent 19ead876d2
commit 750cd1755d
33 changed files with 657 additions and 617 deletions

View File

@@ -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;
}