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...
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117417 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBCommandInterpreter.cpp b/source/API/SBCommandInterpreter.cpp
index 38f4146..f6a95f9 100644
--- a/source/API/SBCommandInterpreter.cpp
+++ b/source/API/SBCommandInterpreter.cpp
@@ -33,11 +33,11 @@
SBCommandInterpreter::SBCommandInterpreter (CommandInterpreter *interpreter) :
m_opaque_ptr (interpreter)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBCommandInterpreter::SBCommandInterpreter (CommandInterpreter *interpreter) interpreter = %p"
- " ==> this = %p", interpreter, this);
+ log->Printf ("SBCommandInterpreter::SBCommandInterpreter (interpreter = %p)"
+ " => this.obj = %p", interpreter, m_opaque_ptr);
}
SBCommandInterpreter::~SBCommandInterpreter ()
@@ -73,8 +73,8 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBCommandInterpreter::HandleCommand ('%s', result, %s)", command_line,
- (add_to_history ? "true" : "false"));
+ log->Printf("SBCommandInterpreter::HandleCommand (this.obj=%p, command_line='%s', result=%p, "
+ "add_to_history='%s')", m_opaque_ptr, command_line, &result, (add_to_history ? "true" : "false"));
result.Clear();
if (m_opaque_ptr)
@@ -91,7 +91,8 @@
{
SBStream sstr;
result.GetDescription (sstr);
- log->Printf ("SBCommandInterpreter::HandleCommand ==> %s", sstr.GetData());
+ log->Printf ("SBCommandInterpreter::HandleCommand (...'%s'...) => SBCommandReturnObject: '%s'",
+ command_line, sstr.GetData());
}
return result.GetStatus();
@@ -231,13 +232,14 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- if (log)
- log->Printf ("SBCommandInterpreter::GetBroadcaster ()");
+ //if (log)
+ // log->Printf ("SBCommandInterpreter::GetBroadcaster ()");
SBBroadcaster broadcaster (m_opaque_ptr, false);
if (log)
- log->Printf ("SBCommandInterpreter::GetBroadcaster ==> %p", m_opaque_ptr);
+ log->Printf ("SBCommandInterpreter::GetBroadcaster (this.obj=%p) => SBBroadcaster (this.m_opaque_ptr=%p)",
+ m_opaque_ptr, broadcaster.get());
return broadcaster;
}