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

@ -70,6 +70,9 @@ protected:
lldb_private::Address &
operator*();
lldb_private::Address *
get ();
#endif

View File

@ -66,6 +66,9 @@ private:
const lldb_private::CompileUnit &
operator*() const;
const lldb_private::CompileUnit *
get () const;
#endif

View File

@ -46,6 +46,11 @@ public:
bool
GetDescription (lldb::SBStream &description);
protected:
lldb_private::Function *
get ();
private:
friend class SBFrame;
friend class SBSymbolContext;

View File

@ -61,6 +61,11 @@ public:
bool
GetDescription (lldb::SBStream &description);
protected:
lldb_private::LineEntry *
get ();
private:
friend class SBCompileUnit;
friend class SBFrame;

View File

@ -48,6 +48,11 @@ public:
bool
GetDescription (lldb::SBStream &description);
protected:
lldb_private::Symbol *
get ();
private:
friend class SBFrame;
friend class SBSymbolContext;

View File

@ -55,6 +55,10 @@ public:
const lldb_private::ValueObjectList &
operator* () const;
lldb_private::ValueObjectList *
get ();
#endif
private:

View File

@ -20,16 +20,12 @@ using namespace lldb_private;
SBAddress::SBAddress () :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBAddress::SBAddress () ==> this = %p (%s)", this);
}
SBAddress::SBAddress (const lldb_private::Address *lldb_object_ptr) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (lldb_object_ptr)
m_opaque_ap.reset (new lldb_private::Address(*lldb_object_ptr));
@ -38,22 +34,22 @@ SBAddress::SBAddress (const lldb_private::Address *lldb_object_ptr) :
{
SBStream sstr;
GetDescription (sstr);
log->Printf ("SBAddress::SBAddress (const lldb_private::Address *lldb_object_ptr) lldb_object_ptr = %p "
"==> this = %p (%s)", lldb_object_ptr, this, sstr.GetData());
log->Printf ("SBAddress::SBAddress (lldb_object_ptr=%p) "
"=> this.ap = %p (%s)", lldb_object_ptr, m_opaque_ap.get(), sstr.GetData());
}
}
SBAddress::SBAddress (const SBAddress &rhs) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (rhs.IsValid())
m_opaque_ap.reset (new lldb_private::Address(*rhs.m_opaque_ap.get()));
if (log)
log->Printf ("SBAddress::SBAddress (const SBAddress &rhs) rhs.m_opaque_ap.get() = %p ==> this = %p",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), this);
log->Printf ("SBAddress::SBAddress (rhs.m_opaque_ap = %p) => this.ap = %p",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), m_opaque_ap.get());
}
SBAddress::~SBAddress ()
@ -71,8 +67,8 @@ SBAddress::operator = (const SBAddress &rhs)
m_opaque_ap.reset (new lldb_private::Address(*rhs.m_opaque_ap.get()));
}
if (log)
log->Printf ("SBAddress::operator= (const SBAddress rhs) rhs = %p ==> this = %p",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), this);
log->Printf ("SBAddress::operator= (rhs.ap = %p) => this.ap = %p",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), m_opaque_ap.get());
return *this;
}
@ -118,20 +114,20 @@ SBAddress::GetLoadAddress (const SBTarget &target) const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBAddress::GetLoadAddress");
//if (log)
// log->Printf ("SBAddress::GetLoadAddress");
if (m_opaque_ap.get())
{
lldb::addr_t addr = m_opaque_ap->GetLoadAddress (target.get());
if (log)
log->Printf ("SBAddress::GetLoadAddress ==> %p", addr);
log->Printf ("SBAddress::GetLoadAddress (target.sp=%p) => %p", target.get(), addr);
return addr;
}
else
{
if (log)
log->Printf ("SBAddress::GetLoadAddress ==> LLDB_INVALID_ADDRESS");
log->Printf ("SBAddress::GetLoadAddress (target.sp=%p) => LLDB_INVALID_ADDRESS", target.get());
return LLDB_INVALID_ADDRESS;
}
}
@ -178,6 +174,11 @@ SBAddress::operator*() const
return *m_opaque_ap;
}
lldb_private::Address *
SBAddress::get ()
{
return m_opaque_ap.get();
}
bool
SBAddress::GetDescription (SBStream &description)

View File

@ -67,23 +67,20 @@ public:
SBBreakpoint::SBBreakpoint () :
m_opaque_sp ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBBreakpoint::SBBreakpoint () ==> this = %p", this);
}
SBBreakpoint::SBBreakpoint (const SBBreakpoint& rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{
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 ("SBBreakpoint::SBBreakpoint (const SBBreakpoint &rhs) rhs.m_opaque_ap.get() = %p ==> this = %p (%s)",
rhs.m_opaque_sp.get(), this, sstr.GetData());
log->Printf ("SBBreakpoint::SBBreakpoint (const SBBreakpoint rhs.sp=%p) "
"=> this.sp = %p (%s)",
rhs.m_opaque_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
}
@ -91,14 +88,14 @@ SBBreakpoint::SBBreakpoint (const SBBreakpoint& rhs) :
SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp) :
m_opaque_sp (bp_sp)
{
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("SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp) bp_sp.get() = %p ==> this = %p (%s)",
bp_sp.get(), this, sstr.GetData());
log->Printf("SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp=%p) => this.sp = %p (%s)",
bp_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
}
@ -111,8 +108,8 @@ SBBreakpoint::operator = (const SBBreakpoint& rhs)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBBreakpoint::operator=");
//if (log)
// log->Printf ("SBBreakpoint::operator=");
if (this != &rhs)
{
@ -120,8 +117,8 @@ SBBreakpoint::operator = (const SBBreakpoint& rhs)
}
if (log)
log->Printf ("SBBreakpoint::operator= (const SBBreakpoint &rhs) rhs.m_opaque_sp.get() = %p ==> this = %p",
rhs.m_opaque_sp.get(), this);
log->Printf ("SBBreakpoint::operator= (const SBBreakpoint &rhs.sp=%p) => this.sp = %p",
rhs.m_opaque_sp.get(), m_opaque_sp.get());
return *this;
}
@ -131,19 +128,19 @@ SBBreakpoint::GetID () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBBreakpoint::GetID");
//if (log)
// log->Printf ("SBBreakpoint::GetID");
if (m_opaque_sp)
{
break_id_t id = m_opaque_sp->GetID();
if (log)
log->Printf ("SBBreakpoint::GetID ==> %d", id);
log->Printf ("SBBreakpoint::GetID (this.sp=%p) => %d", m_opaque_sp.get(), id);
return id;
}
if (log)
log->Printf ("SBBreakpoint::GetID ==> LLDB_INVALID_BREAK_ID");
log->Printf ("SBBreakpoint::GetID (this.sp=%p) => LLDB_INVALID_BREAK_ID", m_opaque_sp.get());
return LLDB_INVALID_BREAK_ID;
}
@ -235,7 +232,8 @@ SBBreakpoint::SetEnabled (bool enable)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBBreakpoint::SetEnabled (%s)", (enable ? "true" : "false"));
log->Printf ("SBBreakpoint::SetEnabled (this.sp=%p, enable='%s')", m_opaque_sp.get(),
(enable ? "true" : "false"));
if (m_opaque_sp)
m_opaque_sp->SetEnabled (enable);
@ -256,7 +254,7 @@ SBBreakpoint::SetIgnoreCount (uint32_t count)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBBreakpoint::SetIgnoreCount (%d)", count);
log->Printf ("SBBreakpoint::SetIgnoreCount (this.sp=%p, count='%d')", m_opaque_sp.get(), count);
if (m_opaque_sp)
m_opaque_sp->SetIgnoreCount (count);
@ -279,20 +277,20 @@ SBBreakpoint::GetHitCount () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBBreakpoint::GetHitCount");
//if (log)
// log->Printf ("SBBreakpoint::GetHitCount");
if (m_opaque_sp)
{
uint32_t hit_count = m_opaque_sp->GetHitCount();
if (log)
log->Printf ("SBBreakpoint::GetHitCount ==> %d", hit_count);
log->Printf ("SBBreakpoint::GetHitCount (this.sp=%p) => '%d'", m_opaque_sp.get(), hit_count);
return m_opaque_sp->GetHitCount();
}
else
{
if (log)
log->Printf ("SBBreakpoint::GetHitCount ==> 0");
log->Printf ("SBBreakpoint::GetHitCount (this.sp=%p) => '0'", m_opaque_sp.get());
return 0;
}
}
@ -463,7 +461,7 @@ SBBreakpoint::SetCallback (BreakpointHitCallback callback, void *baton)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBBreakpoint::SetCallback :");
log->Printf ("SBBreakpoint::SetCallback (this.sp=%p, :", m_opaque_sp.get());
if (m_opaque_sp.get())
{

View File

@ -32,23 +32,19 @@ using namespace lldb_private;
SBBreakpointLocation::SBBreakpointLocation ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBBreakpointLocation::SBBreakpointLocation () ==> this = %p", this);
}
SBBreakpointLocation::SBBreakpointLocation (const lldb::BreakpointLocationSP &break_loc_sp) :
m_opaque_sp (break_loc_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
SBStream sstr;
GetDescription (lldb::eDescriptionLevelBrief, sstr);
log->Printf ("SBBreakpointLocation::SBBreakpointLocaiton (const lldb::BreakpointLocationsSP &break_loc_sp) "
"break_loc_sp.get() = %p ==> this = %p (%s)", break_loc_sp.get(), this, sstr.GetData());
log->Printf ("SBBreakpointLocation::SBBreakpointLocaiton (const lldb::BreakpointLocationsSP &break_loc_sp"
"=%p) => this.sp = %p (%s)", break_loc_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
}
@ -240,8 +236,8 @@ SBBreakpointLocation::GetBreakpoint ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBBreakpointLocation::GetBreakpoint ()");
//if (log)
// log->Printf ("SBBreakpointLocation::GetBreakpoint ()");
SBBreakpoint sb_bp;
if (m_opaque_sp)
@ -251,7 +247,8 @@ SBBreakpointLocation::GetBreakpoint ()
{
SBStream sstr;
sb_bp.GetDescription (sstr);
log->Printf ("SBBreakpointLocation::GetBreakpoint ==> %s", sstr.GetData());
log->Printf ("SBBreakpointLocation::GetBreakpoint (this.sp=%p) => SBBreakpoint: m_opaque_sp=%p, '%s'",
m_opaque_sp.get(), sb_bp.get(), sstr.GetData());
}
return sb_bp;
}

View File

@ -26,7 +26,7 @@ SBBroadcaster::SBBroadcaster () :
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBBroadcastetr::SBBroadcaster () ==> this = %p", this);
log->Printf ("SBBroadcastetr::SBBroadcaster () => this = %p", this);
}
@ -37,7 +37,7 @@ SBBroadcaster::SBBroadcaster (const char *name) :
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBBroadcaster::SBBroadcaster (const char *name) name = '%s' ==> this = %p (m_opaque = %p)",
log->Printf ("SBBroadcaster::SBBroadcaster (name='%s') => this = %p (m_opaque = %p)",
name, this, m_opaque);
}
@ -48,8 +48,8 @@ SBBroadcaster::SBBroadcaster (lldb_private::Broadcaster *broadcaster, bool owns)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBBroadcaster::SBBroadcaster (lldb_private::Broadcaster *broadcaster, bool owns) "
" broadcaster = %p, owns = %s ==> this = %p", broadcaster, (owns ? "true" : "false"), this);
log->Printf ("SBBroadcaster::SBBroadcaster (broadcaster=%p, bool owns='%s') "
" => this = %p (m_opaque = %p)", broadcaster, (owns ? "true" : "false"), this, m_opaque);
}
SBBroadcaster::~SBBroadcaster()

View File

@ -33,11 +33,11 @@ using namespace lldb_private;
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 @@ SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnOb
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 @@ SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnOb
{
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 @@ SBCommandInterpreter::GetBroadcaster ()
{
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;
}

View File

@ -19,10 +19,10 @@ using namespace lldb_private;
SBCommandReturnObject::SBCommandReturnObject () :
m_opaque_ap (new CommandReturnObject ())
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommandReturnObject::SBCommandReturnObject () ==> this = %p", this);
log->Printf ("SBCommandReturnObject::SBCommandReturnObject () => this.ap = %p", m_opaque_ap.get());
}
SBCommandReturnObject::~SBCommandReturnObject ()
@ -42,18 +42,20 @@ SBCommandReturnObject::GetOutput ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommandReturnObject::GetOutput ()");
//if (log)
// log->Printf ("SBCommandReturnObject::GetOutput ()");
if (m_opaque_ap.get())
{
if (log)
log->Printf ("SBCommandReturnObject::GetOutput ==> %s", m_opaque_ap->GetOutputStream().GetData());
log->Printf ("SBCommandReturnObject::GetOutput (this.ap=%p) => '%s'", m_opaque_ap.get(),
m_opaque_ap->GetOutputStream().GetData());
return m_opaque_ap->GetOutputStream().GetData();
}
if (log)
log->Printf ("SBCommandReturnObject::GetOutput ==> NULL");
log->Printf ("SBCommandReturnObject::GetOutput (this.ap=%p) => 'NULL'", m_opaque_ap.get());
return NULL;
}
@ -63,18 +65,20 @@ SBCommandReturnObject::GetError ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommandReturnObject::GetError ()");
//if (log)
// log->Printf ("SBCommandReturnObject::GetError ()");
if (m_opaque_ap.get())
{
if (log)
log->Printf ("SBCommandReturnObject::GetError ==> %s", m_opaque_ap->GetErrorStream().GetData());
log->Printf ("SBCommandReturnObject::GetError (this.ap=%p) => '%s'", m_opaque_ap.get(),
m_opaque_ap->GetErrorStream().GetData());
return m_opaque_ap->GetErrorStream().GetData();
}
if (log)
log->Printf ("SBCommandReturnObject::GetError ==> NULL");
log->Printf ("SBCommandReturnObject::GetError (this.ap=%p) => 'NULL'", m_opaque_ap.get());
return NULL;
}

View File

@ -22,21 +22,17 @@ SBCommunication::SBCommunication() :
m_opaque (NULL),
m_opaque_owned (false)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBCommunication::SBCommunication () ==> this = %p", this);
}
SBCommunication::SBCommunication(const char * broadcaster_name) :
m_opaque (new Communication (broadcaster_name)),
m_opaque_owned (true)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommunication::SBCommunication (const char *broadcaster_name) broadcaster_name = '%s' ==> "
"this = %p (m_opaque = %p)", broadcaster_name, this, m_opaque);
log->Printf ("SBCommunication::SBCommunication (broadcaster_name='%s') => "
"this.obj = %p", broadcaster_name, m_opaque);
}
SBCommunication::~SBCommunication()
@ -88,8 +84,9 @@ SBCommunication::AdoptFileDesriptor (int fd, bool owns_fd)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommunication::AdoptFileDescriptor (%d, %s)", fd, (owns_fd ? "true" : "false"));
//if (log)
// log->Printf ("SBCommunication::AdoptFileDescriptor (this=%p, fd='%d', owns_fd='%s')", this, fd,
// (owns_fd ? "true" : "false"));
if (m_opaque)
{
@ -102,19 +99,22 @@ SBCommunication::AdoptFileDesriptor (int fd, bool owns_fd)
if (m_opaque->IsConnected())
{
if (log)
log->Printf ("SBCommunication::AdoptFileDescriptor ==> eConnectionStatusSuccess");
log->Printf ("SBCommunication::AdoptFileDescriptor (this.obj=%p, fd=%d, ownd_fd='%s') "
"=> eConnectionStatusSuccess", m_opaque, fd, (owns_fd ? "true" : "false"));
return eConnectionStatusSuccess;
}
else
{
{
if (log)
log->Printf ("SBCommunication::AdoptFileDescriptor ==> eConnectionStatusLostConnection");
log->Printf ("SBCommunication::AdoptFileDescriptor (this.obj=%p, fd=%d, ownd_fd='%s') "
"=> eConnectionStatusLostConnection", m_opaque, fd, (owns_fd ? "true" : "false"));
return eConnectionStatusLostConnection;
}
}
if (log)
log->Printf ("SBCommunication::AdoptFileDescriptor ==> eConnectionStatusNoConnection");
log->Printf ("SBCommunication::AdoptFileDescriptor (this,obj=%p, fd=%d, ownd_fd='%s') "
"=> eConnectionStatusNoConnection", m_opaque, fd, (owns_fd ? "true" : "false"));
return eConnectionStatusNoConnection;
}
@ -125,15 +125,16 @@ SBCommunication::Disconnect ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommunication::Disconnect ()");
//if (log)
// log->Printf ("SBCommunication::Disconnect ()");
ConnectionStatus status= eConnectionStatusNoConnection;
if (m_opaque)
status = m_opaque->Disconnect ();
if (log)
log->Printf ("SBCommunication::Disconnect ==> %s", Communication::ConnectionStatusAsCString (status));
log->Printf ("SBCommunication::Disconnect (this.obj=%p) => '%s'", m_opaque,
Communication::ConnectionStatusAsCString (status));
return status;
}
@ -170,15 +171,15 @@ SBCommunication::ReadThreadStart ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommunication::ReadThreadStart ()");
//if (log)
// log->Printf ("SBCommunication::ReadThreadStart ()");
bool success = false;
if (m_opaque)
success = m_opaque->StartReadThread ();
if (log)
log->Printf ("SBCommunication::ReadThreadStart ==> %s", (success ? "true" : "false"));
log->Printf ("SBCommunication::ReadThreadStart (this.obj=%p) => '%s'", m_opaque, (success ? "true" : "false"));
return success;
}
@ -189,15 +190,15 @@ SBCommunication::ReadThreadStop ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommunication::ReadThreadStop ()");
//if (log)
// log->Printf ("SBCommunication::ReadThreadStop ()");
bool success = false;
if (m_opaque)
success = m_opaque->StopReadThread ();
if (log)
log->Printf ("SBCommunication::ReadThreadStop ==> %s", (success ? "true" : "false"));
log->Printf ("SBCommunication::ReadThreadStop (this.obj=%p) => '%s'", m_opaque, (success ? "true" : "false"));
return success;
}
@ -220,19 +221,19 @@ SBCommunication::SetReadThreadBytesReceivedCallback
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCommunication::SetReadThreadBytesReceivedCallback (callback, baton)");
// CAROLINE: Fixme: Fix the arguments printed out in the log message above
log->Printf ("SBCommunication::SetReadThreadBytesReceivedCallback (this.obj=%p, callback=%p, baton=%p)",
m_opaque, callback, callback_baton);
if (m_opaque)
{
m_opaque->SetReadThreadBytesReceivedCallback (callback, callback_baton);
if (log)
log->Printf ("SBCommunication::SetReaDThreadBytesReceivedCallback ==> true");
log->Printf ("SBCommunication::SetReaDThreadBytesReceivedCallback (this.obj=%p...) => true", m_opaque);
return true;
}
if (log)
log->Printf ("SBCommunication::SetReaDThreadBytesReceivedCallback ==> false");
log->Printf ("SBCommunication::SetReaDThreadBytesReceivedCallback (this.obj=%p...) => false", m_opaque);
return false;
}

View File

@ -22,23 +22,19 @@ using namespace lldb_private;
SBCompileUnit::SBCompileUnit () :
m_opaque_ptr (NULL)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBCompileUnit::SBCompileUnit () ==> this = %p", this);
}
SBCompileUnit::SBCompileUnit (lldb_private::CompileUnit *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 ("SBCompileUnit::SBCompileUnit (lldb_private::CompileUnit *lldb_object_ptr) lldb_object_ptr = %p"
" this = %p (%s)", lldb_object_ptr, this, sstr.GetData());
log->Printf ("SBCompileUnit::SBCompileUnit (lldb_private::CompileUnit *lldb_object_ptr=%p)"
" => this.obj = %p (%s)", lldb_object_ptr, m_opaque_ptr, sstr.GetData());
}
}
@ -73,8 +69,8 @@ SBCompileUnit::GetLineEntryAtIndex (uint32_t idx) const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBCompileUnit::GetLineEntryAtIndex (%d)", idx);
//if (log)
// log->Printf ("SBCompileUnit::GetLineEntryAtIndex (this.obj=%p, idx=%d)", m_opaque_ptr, idx);
SBLineEntry sb_line_entry;
if (m_opaque_ptr)
@ -92,7 +88,8 @@ SBCompileUnit::GetLineEntryAtIndex (uint32_t idx) const
{
SBStream sstr;
sb_line_entry.GetDescription (sstr);
log->Printf ("SBCompileUnit::GetLineEntryAtIndex ==> %s", sstr.GetData());
log->Printf ("SBCompileUnit::GetLineEntryAtIndex (this.obj=%p, idx=%d) => SBLineEntry: '%s'", m_opaque_ptr,
idx, sstr.GetData());
}
return sb_line_entry;
@ -103,12 +100,13 @@ SBCompileUnit::FindLineEntryIndex (uint32_t start_idx, uint32_t line, SBFileSpec
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
SBStream sstr;
inline_file_spec->GetDescription (sstr);
log->Printf ("SBCompileUnit::FindLineEntryIndex (%d, %d, %s)", start_idx, line, sstr.GetData());
}
//if (log)
//{
// SBStream sstr;
// inline_file_spec->GetDescription (sstr);
// log->Printf ("SBCompileUnit::FindLineEntryIndex (this.obj=%p, start_idx=%d, line=%d, inline_file_spec='%s')",
// m_opaque_ptr, start_idx, line, sstr.GetData());
//}
if (m_opaque_ptr)
{
@ -124,13 +122,23 @@ SBCompileUnit::FindLineEntryIndex (uint32_t start_idx, uint32_t line, SBFileSpec
inline_file_spec ? inline_file_spec->get() : NULL,
NULL);
if (log)
log->Printf ("SBCompileUnit::FindLineEntryIndex ==> %d", ret_value);
{
SBStream sstr;
inline_file_spec->GetDescription (sstr);
log->Printf ("SBCompileUnit::FindLineEntryIndex(this.obj=%p, start_idx=%d, line=%d, inline_file_spec='%s')"
"=> '%d'", m_opaque_ptr, start_idx, line, sstr.GetData(), ret_value);
}
return ret_value;
}
if (log)
log->Printf ("SBCompileUnit::FindLineEntryIndex ==> %d", UINT32_MAX);
{
SBStream sstr;
inline_file_spec->GetDescription (sstr);
log->Printf ("SBCompileUnit::FindLineEntryIndex (this.obj=%p, start_idx=%d, line=%d, inline_file_spec='%s')"
" => '%d'", m_opaque_ptr, start_idx, line, sstr.GetData(), UINT32_MAX);
}
return UINT32_MAX;
}
@ -165,6 +173,12 @@ SBCompileUnit::operator*() const
return *m_opaque_ptr;
}
const lldb_private::CompileUnit *
SBCompileUnit::get () const
{
return m_opaque_ptr;
}
bool
SBCompileUnit::GetDescription (SBStream &description)
{

View File

@ -67,8 +67,8 @@ SBDebugger::Create()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::Create ()");
//if (log)
// log->Printf ("SBDebugger::Create ()");
SBDebugger debugger;
debugger.reset(Debugger::CreateInstance());
@ -77,7 +77,7 @@ SBDebugger::Create()
{
SBStream sstr;
debugger.GetDescription (sstr);
log->Printf ("SBDebugger::Create ==> %s", sstr.GetData());
log->Printf ("SBDebugger::Create () => SBDebugger (this.sp = %p, '%s')", debugger.m_opaque_sp.get(), sstr.GetData());
}
return debugger;
@ -121,7 +121,8 @@ SBDebugger::SetInputFileHandle (FILE *fh, bool transfer_ownership)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::SetInputFileHandle (%p, %s)", fh, (transfer_ownership ? "true" : "false"));
log->Printf ("SBDebugger::SetInputFileHandle (this.sp=%p, fh=%p, transfer_ownership='%s')", m_opaque_sp.get(),
fh, (transfer_ownership ? "true" : "false"));
if (m_opaque_sp)
m_opaque_sp->SetInputFileHandle (fh, transfer_ownership);
@ -134,7 +135,8 @@ SBDebugger::SetOutputFileHandle (FILE *fh, bool transfer_ownership)
if (log)
log->Printf ("SBDebugger::SetOutputFileHandle (%p, %s)", fh, (transfer_ownership ? "true" : "false"));
log->Printf ("SBDebugger::SetOutputFileHandle (this.sp=%p, fh=%p, transfer_ownership='%s')", m_opaque_sp.get(),
fh, (transfer_ownership ? "true" : "false"));
if (m_opaque_sp)
m_opaque_sp->SetOutputFileHandle (fh, transfer_ownership);
@ -147,7 +149,8 @@ SBDebugger::SetErrorFileHandle (FILE *fh, bool transfer_ownership)
if (log)
log->Printf ("SBDebugger::SetErrorFileHandle (%p, %s)", fh, (transfer_ownership ? "true" : "false"));
log->Printf ("SBDebugger::SetErrorFileHandle (this.sp=%p, fh=%p, transfer_ownership='%s')", m_opaque_sp.get(),
fh, (transfer_ownership ? "true" : "false"));
if (m_opaque_sp)
m_opaque_sp->SetErrorFileHandle (fh, transfer_ownership);
@ -182,13 +185,14 @@ SBDebugger::GetCommandInterpreter ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::GetCommandInterpreter ()");
SBCommandInterpreter sb_interpreter;
if (m_opaque_sp)
sb_interpreter.reset (&m_opaque_sp->GetCommandInterpreter());
if (log)
log->Printf ("SBDebugger::GetCommandInterpreter (this.sp=%p) => SBCommandInterpreter (this.obj=%p)",
m_opaque_sp.get(), sb_interpreter.get());
return sb_interpreter;
}
@ -229,13 +233,14 @@ SBDebugger::GetListener ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::GetListener ()");
SBListener sb_listener;
if (m_opaque_sp)
sb_listener.reset(&m_opaque_sp->GetListener(), false);
if (log)
log->Printf ("SBDebugger::GetListener (this.sp=%p) => SBListener (this.obj=%p)", m_opaque_sp.get(),
sb_listener.get());
return sb_listener;
}
@ -412,7 +417,8 @@ SBDebugger::StateAsCString (lldb::StateType state)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::StateAsCString ==> %s", lldb_private::StateAsCString (state));
log->Printf ("SBDebugger::StateAsCString (state=%d) => '%s'", state,
lldb_private::StateAsCString (state));
return lldb_private::StateAsCString (state);
}
@ -429,7 +435,7 @@ SBDebugger::StateIsStoppedState (lldb::StateType state)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::StateIsStoppedState ==> %s",
log->Printf ("SBDebugger::StateIsStoppedState (state=%d) => '%s'", state,
(lldb_private::StateIsStoppedState (state) ? "true" : "false"));
return lldb_private::StateIsStoppedState (state);
@ -458,8 +464,9 @@ SBDebugger::CreateTargetWithFileAndArch (const char *filename, const char *archn
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::CreateTargetWithFileAndArch (%s, %s)", filename, archname);
//if (log)
// log->Printf ("SBDebugger::CreateTargetWithFileAndArch (this.sp=%p, filename='%s', arcname='%s')",
// m_opaque_sp.get() filename, archname);
SBTarget target;
if (m_opaque_sp)
@ -503,7 +510,9 @@ SBDebugger::CreateTargetWithFileAndArch (const char *filename, const char *archn
{
SBStream sstr;
target.GetDescription (sstr, lldb::eDescriptionLevelFull);
log->Printf ("SBDebugger::CreateTargetWithFileAndArch ==> %s", sstr.GetData());
log->Printf ("SBDebugger::CreateTargetWithFileAndArch (this.sp=%p, filename='%s', arcname='%s') "
"=> SBTarget: this.sp=%p, '%s'", m_opaque_sp.get(), filename, archname, target.get(),
sstr.GetData());
}
return target;
@ -600,8 +609,8 @@ SBDebugger::GetSelectedTarget ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::GetSelectedTarget ()");
//if (log)
// log->Printf ("SBDebugger::GetSelectedTarget ()");
SBTarget sb_target;
if (m_opaque_sp)
@ -611,7 +620,8 @@ SBDebugger::GetSelectedTarget ()
{
SBStream sstr;
sb_target.GetDescription (sstr, lldb::eDescriptionLevelBrief);
log->Printf ("SBDebugger::GetSelectedTarget ==> %s", sstr.GetData());
log->Printf ("SBDebugger::GetSelectedTarget (this.sp=%p) => SBTarget: this.sp=%p, '%s'", m_opaque_sp.get(),
sb_target.get(), sstr.GetData());
}
return sb_target;
@ -623,7 +633,8 @@ SBDebugger::DispatchInput (void *baton, const void *data, size_t data_len)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::DispatchInput (%p, %s, %d)", baton, (const char *) data, (uint32_t) data_len);
log->Printf ("SBDebugger::DispatchInput (this.sp=%p, baton=%p, data='%s', size_t=%d)", m_opaque_sp.get(),
baton, (const char *) data, (uint32_t) data_len);
if (m_opaque_sp)
m_opaque_sp->DispatchInput ((const char *) data, data_len);
@ -635,7 +646,7 @@ SBDebugger::PushInputReader (SBInputReader &reader)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::PushInputReader (%p)", &reader);
log->Printf ("SBDebugger::PushInputReader (this.sp=%p, reader=%p)", m_opaque_sp.get(), &reader);
if (m_opaque_sp && reader.IsValid())
{
@ -742,7 +753,8 @@ SBDebugger::GetPrompt() const
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBDebugger::GetPrompt ==> '%s'", (m_opaque_sp ? m_opaque_sp->GetPrompt() : ""));
log->Printf ("SBDebugger::GetPrompt (this.sp=%p) => '%s'", m_opaque_sp.get(),
(m_opaque_sp ? m_opaque_sp->GetPrompt() : ""));
if (m_opaque_sp)
return m_opaque_sp->GetPrompt ();

View File

@ -21,16 +21,12 @@ using namespace lldb_private;
SBError::SBError () :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBError::SBError () ==> this = %p", this);
}
SBError::SBError (const SBError &rhs) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (rhs.IsValid())
m_opaque_ap.reset (new Error(*rhs));
@ -39,8 +35,8 @@ SBError::SBError (const SBError &rhs) :
{
SBStream sstr;
GetDescription (sstr);
log->Printf ("SBError::SBError (const SBError &rhs) rhs.m_opaque_ap.get() = %p ==> this = %p (%s)",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), this, sstr.GetData());
log->Printf ("SBError::SBError (const SBError rhs.ap=%p) => this.ap = %p (%s)",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), m_opaque_ap.get(), sstr.GetData());
}
}
@ -54,14 +50,6 @@ SBError::operator = (const SBError &rhs)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
SBStream sstr;
rhs.GetDescription (sstr);
log->Printf ("SBError::operator= (const SBError &rhs) rhs.m_opaque_ap.get() = %p (%s)",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), sstr.GetData());
}
if (rhs.IsValid())
{
if (m_opaque_ap.get())
@ -75,7 +63,12 @@ SBError::operator = (const SBError &rhs)
}
if (log)
log->Printf ("SBError::operator= ==> this = %p", this);
{
SBStream sstr;
GetDescription (sstr);
log->Printf ("SBError::operator= (this.ap=%p, rhs.ap=%p) => this (%s)",
m_opaque_ap.get(), (rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), sstr.GetData());
}
return *this;
}
@ -101,15 +94,15 @@ SBError::Fail () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBError::Fail ()");
//if (log)
// log->Printf ("SBError::Fail ()");
bool ret_value = false;
if (m_opaque_ap.get())
ret_value = m_opaque_ap->Fail();
if (log)
log->Printf ("SBError::Fail ==> %s", (ret_value ? "true" : "false"));
log->Printf ("SBError::Fail (this.ap=%p) => '%s'", m_opaque_ap.get(), (ret_value ? "true" : "false"));
return ret_value;
}

View File

@ -27,23 +27,18 @@ SBEvent::SBEvent () :
m_event_sp (),
m_opaque (NULL)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBEvent::SBEvent () ==> this = %p", this);
}
SBEvent::SBEvent (uint32_t event_type, const char *cstr, uint32_t cstr_len) :
m_event_sp (new Event (event_type, new EventDataBytes (cstr, cstr_len))),
m_opaque (m_event_sp.get())
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
log->Printf ("SBEvent::SBEvent (uint32_t event_type, const char *cstr, uint32_t cstr_len)");
log->Printf (" event_type = %d, cstr = '%s', cstr_len = %d ==> this = %p (m_opaque = %p)", event_type,
cstr, cstr_len, this, m_opaque);
log->Printf ("SBEvent::SBEvent (event_type=%d, cstr='%s', cstr_len=%d) => this.sp = %p", event_type,
cstr, cstr_len, m_opaque);
}
}
@ -51,10 +46,10 @@ SBEvent::SBEvent (EventSP &event_sp) :
m_event_sp (event_sp),
m_opaque (event_sp.get())
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBEvent::SBEvent (EventSP &event_sp) event_sp.get() = %p ==> this = %p", event_sp.get(), this);
log->Printf ("SBEvent::SBEvent (event_sp=%p) => this.sp = %p", event_sp.get(), m_opaque);
}
SBEvent::~SBEvent()
@ -75,8 +70,8 @@ SBEvent::GetType () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBEvent::GetType ()");
//if (log)
// log->Printf ("SBEvent::GetType ()");
const Event *lldb_event = get();
uint32_t event_type = 0;
@ -84,7 +79,7 @@ SBEvent::GetType () const
event_type = lldb_event->GetType();
if (log)
log->Printf ("SBEvent::GetType ==> %d", event_type);
log->Printf ("SBEvent::GetType (this.sp=%p) => %d", m_opaque, event_type);
return event_type;
}
@ -125,7 +120,8 @@ SBEvent::BroadcasterMatchesRef (const SBBroadcaster &broadcaster)
success = lldb_event->BroadcasterIs (broadcaster.get());
if (log)
log->Printf ("SBEvent::BroadcasterMathesRef ==> %s", (success ? "true" : "false"));
log->Printf ("SBEvent::BroadcasterMathesRef (this.sp=%p, broadcaster.obj=%p) => %s", m_opaque,
broadcaster.get(), (success ? "true" : "false"));
return success;
}
@ -186,7 +182,7 @@ SBEvent::GetCStringFromEvent (const SBEvent &event)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("GetCStringFromEvent ==> %s",
log->Printf ("GetCStringFromEvent (event.sp=%p) => %s", event.m_opaque,
reinterpret_cast<const char *>(EventDataBytes::GetBytesFromEvent (event.get())));
return reinterpret_cast<const char *>(EventDataBytes::GetBytesFromEvent (event.get()));

View File

@ -20,27 +20,23 @@ using namespace lldb_private;
SBFileSpec::SBFileSpec () :
m_opaque_ap()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBFileSpec::SBFileSpec () ==> this = %p", this);
}
SBFileSpec::SBFileSpec (const SBFileSpec &rhs) :
m_opaque_ap()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (rhs.m_opaque_ap.get())
m_opaque_ap.reset (new FileSpec (rhs.get()));
if (log)
{
SBStream sstr;
rhs.GetDescription (sstr);
log->Printf ("SBFileSpec::SBFileSpec (const SBFileSpec &rhs) rhs.m_opaque_ap.get() = %p (%s) ==> this = %p",
rhs.m_opaque_ap.get(), sstr.GetData(), this);
GetDescription (sstr);
log->Printf ("SBFileSpec::SBFileSpec (const SBFileSpec rhs.ap=%p) => this.ap = %p ('%s')",
rhs.m_opaque_ap.get(), m_opaque_ap.get(), sstr.GetData());
}
if (rhs.m_opaque_ap.get())
m_opaque_ap.reset (new FileSpec (rhs.get()));
}
// Deprected!!!
@ -52,12 +48,11 @@ SBFileSpec::SBFileSpec (const char *path) :
SBFileSpec::SBFileSpec (const char *path, bool resolve) :
m_opaque_ap(new FileSpec (path, resolve))
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFileSpec::SBFileSpec (const char *path, bool resolve) path = '%s', resolve = %s ==> "
"this = %p (m_opaque_ap.get() = %p)", path, (resolve ? "true" : "false"), this,
m_opaque_ap.get());
log->Printf ("SBFileSpec::SBFileSpec (path='%s', resolve='%s') => this.ap = %p", path,
(resolve ? "true" : "false"), m_opaque_ap.get());
}
SBFileSpec::~SBFileSpec ()
@ -86,15 +81,15 @@ SBFileSpec::Exists () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFileSpec::Exists ()");
//if (log)
// log->Printf ("SBFileSpec::Exists (this.ap=%p)", m_opaque_ap.get());
bool result = false;
if (m_opaque_ap.get())
result = m_opaque_ap->Exists();
if (log)
log->Printf ("SBFileSpec::Exists ==> %s", (result ? "true" : "false"));
log->Printf ("SBFileSpec::Exists (this.ap=%p) => %s", m_opaque_ap.get(), (result ? "true" : "false"));
return result;
}
@ -118,18 +113,20 @@ SBFileSpec::GetFilename() const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFileSpec::GetFilename ()");
//if (log)
// log->Printf ("SBFileSpec::GetFilename (this.ap=%p)", m_opaque_ap.get());
if (m_opaque_ap.get())
{
if (log)
log->Printf ("SBFileSpec::GetFilename ==> %s", m_opaque_ap->GetFilename().AsCString());
log->Printf ("SBFileSpec::GetFilename (this.ap=%p) => %s", m_opaque_ap.get(),
m_opaque_ap->GetFilename().AsCString());
return m_opaque_ap->GetFilename().AsCString();
}
if (log)
log->Printf ("SBFileSpec::GetFilename ==> NULL");
log->Printf ("SBFileSpec::GetFilename (this.ap=%p) => NULL", m_opaque_ap.get());
return NULL;
}
@ -147,20 +144,21 @@ SBFileSpec::GetPath (char *dst_path, size_t dst_len) const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFileSpec::GetPath (dst_path, dst_len)");
//if (log)
// log->Printf ("SBFileSpec::GetPath (dst_path, dst_len)");
uint32_t result;
if (m_opaque_ap.get())
{
result = m_opaque_ap->GetPath (dst_path, dst_len);
if (log)
log->Printf ("SBFileSpec::GetPath ==> %s (%d)", dst_path, result);
log->Printf ("SBFileSpec::GetPath (this.ap=%p, dst_path, dst_len) => dst_path='%s', dst_len='%d', "
"result='%d'", m_opaque_ap.get(), dst_path, (uint32_t) dst_len, result);
return result;
}
if (log)
log->Printf ("SBFileSpec::GetPath ==> NULL (0)");
log->Printf ("SBFileSpec::GetPath (this.ap=%p, dst_path, dst_len) => NULL (0)", m_opaque_ap.get());
if (dst_path && dst_len)
*dst_path = '\0';

View File

@ -46,23 +46,20 @@ using namespace lldb_private;
SBFrame::SBFrame () :
m_opaque_sp ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBFrame::SBFrame () ==> this = %p", this);
}
SBFrame::SBFrame (const lldb::StackFrameSP &lldb_object_sp) :
m_opaque_sp (lldb_object_sp)
{
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 ("SBFrame::SBFrame (const lldb::StackFrameSP &lldb_object_sp) lldb_object_sp.get() = %p "
" ==> this = %p (%s)", lldb_object_sp.get(), this, sstr.GetData());
log->Printf ("SBFrame::SBFrame (lldb_object_sp=%p) => this.sp = %p (%s)", lldb_object_sp.get(),
m_opaque_sp.get(), sstr.GetData());
}
}
@ -89,15 +86,16 @@ SBFrame::GetSymbolContext (uint32_t resolve_scope) const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFrame::GetSymbolContext (%d)", resolve_scope);
//if (log)
// log->Printf ("SBFrame::GetSymbolContext (this.sp=%p, resolve_scope=%d)", m_opaque_sp.get(), resolve_scope);
SBSymbolContext sb_sym_ctx;
if (m_opaque_sp)
sb_sym_ctx.SetSymbolContext(&m_opaque_sp->GetSymbolContext (resolve_scope));
if (log)
log->Printf ("SBFrame::GetSymbolContext ==> SBSymbolContext (this = %p)", &sb_sym_ctx);
log->Printf ("SBFrame::GetSymbolContext (this.sp=%p, resolve_scope=%d) => SBSymbolContext (this.ap = %p)",
m_opaque_sp.get(), resolve_scope, sb_sym_ctx.get());
return sb_sym_ctx;
}
@ -114,13 +112,14 @@ SBFrame::GetCompileUnit () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFrame::GetCompileUnit()");
//if (log)
// log->Printf ("SBFrame::GetCompileUnit()");
SBCompileUnit sb_comp_unit(m_opaque_sp->GetSymbolContext (eSymbolContextCompUnit).comp_unit);
if (log)
log->Printf ("SBFrame::GetCompileUnit ==> SBCompileUnit (this = %p", &sb_comp_unit);
log->Printf ("SBFrame::GetCompileUnit (this.sp=%p) => SBCompileUnit (this=%p)", m_opaque_sp.get(),
sb_comp_unit.get());
return sb_comp_unit;
}
@ -174,15 +173,15 @@ SBFrame::GetPC () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFrame::GetPC ()");
//if (log)
// log->Printf ("SBFrame::GetPC (this.sp=%p)", m_opaque_sp.get());
lldb::addr_t addr = LLDB_INVALID_ADDRESS;
if (m_opaque_sp)
addr = m_opaque_sp->GetFrameCodeAddress().GetLoadAddress (&m_opaque_sp->GetThread().GetProcess().GetTarget());
if (log)
log->Printf ("SBFrame::GetPC ==> %p", addr);
log->Printf ("SBFrame::GetPC (this.sp=%p) => %p", m_opaque_sp.get(), addr);
return addr;
}
@ -192,15 +191,16 @@ SBFrame::SetPC (lldb::addr_t new_pc)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFrame::SetPC (%p)", new_pc);
//if (log)
// log->Printf ("SBFrame::SetPC (this.sp=%p, new_pc=%p)", m_opaque_sp.get(), new_pc);
bool ret_val = false;
if (m_opaque_sp)
ret_val = m_opaque_sp->GetRegisterContext()->SetPC (new_pc);
if (log)
log->Printf ("SBFrame::SetPC ==> %s", (ret_val ? "true" : "false"));
log->Printf ("SBFrame::SetPC (this.sp=%p, new_pc=%p) => '%s'", m_opaque_sp.get(), new_pc,
(ret_val ? "true" : "false"));
return ret_val;
}
@ -219,15 +219,15 @@ SBFrame::GetFP () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFrame::GetFP ()");
//if (log)
// log->Printf ("SBFrame::GetFP ()");
lldb::addr_t addr = LLDB_INVALID_ADDRESS;
if (m_opaque_sp)
addr = m_opaque_sp->GetRegisterContext()->GetFP();
if (log)
log->Printf ("SBFrame::GetFP ==> %p", addr);
log->Printf ("SBFrame::GetFP (this.sp=%p) => %p", m_opaque_sp.get(), addr);
return addr;
}
@ -367,13 +367,18 @@ SBFrame::GetThread () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFrame::GetThread ()");
//if (log)
// log->Printf ("SBFrame::GetThread ()");
SBThread sb_thread (m_opaque_sp->GetThread().GetSP());
if (log)
log->Printf ("SBFrame::GetThread ==> SBThread (this = %p)", &sb_thread);
{
SBStream sstr;
sb_thread.GetDescription (sstr);
log->Printf ("SBFrame::GetThread (this.sp=%p) => SBThread : this.sp= %p, '%s'", m_opaque_sp.get(),
sb_thread.GetLLDBObjectPtr(), sstr.GetData());
}
return sb_thread;
}
@ -385,9 +390,9 @@ SBFrame::Disassemble () const
Log *verbose_log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (verbose_log)
verbose_log->Printf ("SBFrame::Disassemble () ==> %s", m_opaque_sp->Disassemble());
verbose_log->Printf ("SBFrame::Disassemble (this.sp=%p) => %s", m_opaque_sp.get(), m_opaque_sp->Disassemble());
else if (log)
log->Printf ("SBFrame::Disassemble ()");
log->Printf ("SBFrame::Disassemble (this.sp=%p)", m_opaque_sp.get());
if (m_opaque_sp)
return m_opaque_sp->Disassemble();
@ -411,14 +416,12 @@ SBFrame::GetVariables (bool arguments,
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
log->Printf ("SBFrame::GetVariables (bool arguments, bool locals, bool statics, bool in_scope_only)");
log->Printf (" arguments = %s, locals = %s, statics = %s, in_scope_only = %s",
log->Printf ("SBFrame::GetVariables (this_sp.get=%p, arguments=%s, locals=%s, statics=%s, in_scope_only=%s)",
m_opaque_sp.get(),
(arguments ? "true" : "false"),
(locals ? "true" : "false"),
(statics ? "true" : "false"),
(in_scope_only ? "true" : "false"));
}
SBValueList value_list;
if (m_opaque_sp)
@ -469,7 +472,8 @@ SBFrame::GetVariables (bool arguments,
if (log)
{
log->Printf ("SBFrame::GetVariables ==> SBValueList (this = %p)", &value_list);
log->Printf ("SBFrame::GetVariables (this.sp=%p,...) => SBValueList (this.ap = %p)", m_opaque_sp.get(),
value_list.get());
//uint32_t num_vars = value_list.GetSize();
//for (uint32_t i = 0; i < num_vars; ++i)
//{
@ -486,8 +490,8 @@ SBFrame::GetRegisters ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFrame::GetRegisters ()");
//if (log)
// log->Printf ("SBFrame::GetRegisters ()");
SBValueList value_list;
if (m_opaque_sp)
@ -505,7 +509,8 @@ SBFrame::GetRegisters ()
if (log)
{
log->Printf ("SBFrame::Registers ==> SBValueList (this = %p)", &value_list );
log->Printf ("SBFrame::Registers (this.sp=%p) => SBValueList (this.ap = %p)", m_opaque_sp.get(),
value_list.get() );
//uint32_t num_vars = value_list.GetSize();
//for (uint32_t i = 0; i < num_vars; ++i)
//{

View File

@ -25,23 +25,20 @@ using namespace lldb_private;
SBFunction::SBFunction () :
m_opaque_ptr (NULL)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBFunction::SBFunction () ==> this = %p", this);
}
SBFunction::SBFunction (lldb_private::Function *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 ("SBFunction::SBFunction (lldb_Private::Function *lldb_object_ptr) lldb_object_ptr = %p "
" ==> this = %p (%s)", lldb_object_ptr, this, sstr.GetData());
log->Printf ("SBFunction::SBFunction (lldb_object_ptr=%p) => this.obj = %p ('%s')", lldb_object_ptr,
m_opaque_ptr, sstr.GetData());
}
}
@ -61,18 +58,19 @@ SBFunction::GetName() const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBFunction::GetName ()");
//if (log)
// log->Printf ("SBFunction::GetName ()");
if (m_opaque_ptr)
{
if (log)
log->Printf ("SBFunction::GetName ==> %s", m_opaque_ptr->GetMangled().GetName().AsCString());
log->Printf ("SBFunction::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 ("SBFunction::GetName ==> NULL");
log->Printf ("SBFunction::GetName (this.obj=%p) => NULL", m_opaque_ptr);
return NULL;
}
@ -136,4 +134,9 @@ SBFunction::GetInstructions (SBTarget target)
return sb_instructions;
}
lldb_private::Function *
SBFunction::get ()
{
return m_opaque_ptr;
}

View File

@ -38,7 +38,8 @@ SBHostOS::ThreadCreate
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBHostOS::ThreadCreate (%s, %p, %p, error_ptr)", name, thread_function, thread_arg);
log->Printf ("SBHostOS::ThreadCreate (name='%s', thread_function=%p, thread_arg=%p, error_ptr=%p)", name,
thread_function, thread_arg, error_ptr);
// CAROLINE: FIXME: You need to log a return value?

View File

@ -28,30 +28,26 @@ SBInputReader::SBInputReader () :
m_callback_baton (NULL)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBInputReader::SBInputReader () ==> this = %p", this);
}
SBInputReader::SBInputReader (const lldb::InputReaderSP &reader_sp) :
m_opaque_sp (reader_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBInputReader::SBInputReader (const lldb::InputReaderSP &reader_sp) reader_sp.get = %p"
" ==> this = %p", this);
log->Printf ("SBInputReader::SBInputReader (reader_sp=%p) => this.sp = %p", reader_sp.get(),
m_opaque_sp.get());
}
SBInputReader::SBInputReader (const SBInputReader &rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf("SBInputReader::SBInputReader (const SBInputReader &rhs) rhs.m_opaque_sp.get() = %p ==> this = %p",
rhs.m_opaque_sp.get(), this);
log->Printf("SBInputReader::SBInputReader (rhs.sp=%p) => this.sp = %p",
rhs.m_opaque_sp.get(), m_opaque_sp.get());
}
SBInputReader::~SBInputReader ()
@ -91,13 +87,10 @@ SBInputReader::Initialize
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
log->Printf("SBInputReader::Initialize (SBDebugger &debugger, Callback callback_function, void *baton, "
"lldb::InputReaderGranularity granularity, const char *end_token, const char *prompt, bool echo)");
log->Printf(" debugger (this = %p), callback_function, callback_baton = %p, granularity = %s, "
"end_token = '%s', prompt = '%s', echo = %s", &debugger, callback_baton,
InputReader::GranularityAsCString (granularity), end_token, prompt, (echo ? "true" : "false"));
}
log->Printf("SBInputReader::Initialize (this.sp=%p, debugger.sp=%p, callback_function=%p, callback_baton=%p, "
"granularity='%s', end_token='%s', prompt='%s', echo=%s)", m_opaque_sp.get(), debugger.get(),
callback_baton, InputReader::GranularityAsCString (granularity), end_token, prompt,
(echo ? "true" : "false"));
SBError sb_error;
m_opaque_sp.reset (new InputReader (debugger.ref()));
@ -126,7 +119,8 @@ SBInputReader::Initialize
{
SBStream sstr;
sb_error.GetDescription (sstr);
log->Printf ("SBInputReader::Initialize ==> SBError (this = %p, '%s')", &sb_error, sstr.GetData());
log->Printf ("SBInputReader::Initialize (this.sp=%p, ...) => SBError (this.ap=%p, '%s')", m_opaque_sp.get(),
sb_error.get(), sstr.GetData());
}
return sb_error;
@ -198,15 +192,16 @@ SBInputReader::IsActive () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBInputReader::IsActive ()");
//if (log)
// log->Printf ("SBInputReader::IsActive ()");
bool ret_value = false;
if (m_opaque_sp)
ret_value = m_opaque_sp->IsActive();
if (log)
log->Printf ("SBInputReader::IsActive ==> %s", (ret_value ? "true" : "false"));
log->Printf ("SBInputReader::IsActive (this.sp=%p) => '%s'", m_opaque_sp.get(),
(ret_value ? "true" : "false"));
return ret_value;
}

View File

@ -19,16 +19,12 @@ using namespace lldb_private;
SBLineEntry::SBLineEntry () :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBLineEntry::SBLineEntry () ==> this = %p", this);
}
SBLineEntry::SBLineEntry (const SBLineEntry &rhs) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (rhs.IsValid())
{
@ -36,8 +32,8 @@ SBLineEntry::SBLineEntry (const SBLineEntry &rhs) :
}
if (log)
log->Printf ("SBLineEntry::SBLineEntry (const SBLineEntry &rhs) rhs.m_opaque_ap.get() = %p ==> this = %p ",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), this);
log->Printf ("SBLineEntry::SBLineEntry (rhs.ap=%p) => this.ap = %p ",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), m_opaque_ap.get());
}
@ -46,14 +42,14 @@ SBLineEntry::SBLineEntry (const SBLineEntry &rhs) :
SBLineEntry::SBLineEntry (const lldb_private::LineEntry *lldb_object_ptr) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (lldb_object_ptr)
m_opaque_ap.reset (new lldb_private::LineEntry(*lldb_object_ptr));
if (log)
log->Printf ("SBLineEntry::SBLineEntry (const lldb_private::LineEntry *lldb_object_ptr) lldb_object_ptr = %p"
" ==> this = %p (m_opaque_ap.get() = %p)", lldb_object_ptr, this, m_opaque_ap.get());
log->Printf ("SBLineEntry::SBLineEntry (lldb_object_ptr=%p) => this.ap = %p",
lldb_object_ptr, m_opaque_ap.get());
}
const SBLineEntry &
@ -87,8 +83,8 @@ SBLineEntry::GetStartAddress () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBLineEntry::GetStartAddress ()");
//if (log)
// log->Printf ("SBLineEntry::GetStartAddress ()");
SBAddress sb_address;
if (m_opaque_ap.get())
@ -98,7 +94,8 @@ SBLineEntry::GetStartAddress () const
{
SBStream sstr;
sb_address.GetDescription (sstr);
log->Printf ("SBLineEntry::GetStartAddress ==> SBAddress (this = %p, (%s)", &sb_address, sstr.GetData());
log->Printf ("SBLineEntry::GetStartAddress (this.ap=%p) => SBAddress (this.ap = %p, (%s)", m_opaque_ap.get(),
sb_address.get(), sstr.GetData());
}
return sb_address;
@ -128,8 +125,8 @@ SBLineEntry::GetFileSpec () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBLineEntry::GetFileSpec ()");
//if (log)
// log->Printf ("SBLineEntry::GetFileSpec ()");
SBFileSpec sb_file_spec;
if (m_opaque_ap.get() && m_opaque_ap->file)
@ -139,7 +136,8 @@ SBLineEntry::GetFileSpec () const
{
SBStream sstr;
sb_file_spec.GetDescription (sstr);
log->Printf ("SBLineEntry::GetFileSpec ==> SBFileSpec (this = %p, '%s'", &sb_file_spec, sstr.GetData());
log->Printf ("SBLineEntry::GetFileSpec (this.ap=%p) => SBFileSpec : this.ap = %p, '%s'", m_opaque_ap.get(),
sb_file_spec.get(), sstr.GetData());
}
return sb_file_spec;
@ -150,15 +148,15 @@ SBLineEntry::GetLine () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBLineEntry::GetLine ()");
//if (log)
// log->Printf ("SBLineEntry::GetLine ()");
uint32_t line = 0;
if (m_opaque_ap.get())
line = m_opaque_ap->line;
if (log)
log->Printf ("SBLineEntry::GetLine ==> %d", line);
log->Printf ("SBLineEntry::GetLine (this.ap=%p) => %d", m_opaque_ap.get(), line);
return line;
}
@ -227,3 +225,9 @@ SBLineEntry::GetDescription (SBStream &description)
return true;
}
lldb_private::LineEntry *
SBLineEntry::get ()
{
return m_opaque_ap.get();
}

View File

@ -25,32 +25,28 @@ SBListener::SBListener () :
m_opaque_ptr (NULL),
m_opaque_ptr_owned (false)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBListener::SBListener () ==> this = %p", this);
}
SBListener::SBListener (const char *name) :
m_opaque_ptr (new Listener (name)),
m_opaque_ptr_owned (true)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBListener::SBListener (const char *name) name = %s ==> this = %p (m_opaque_ptr = %p)",
name, this, m_opaque_ptr);
log->Printf ("SBListener::SBListener (name='%s') => this.obj = %p",
name, m_opaque_ptr);
}
SBListener::SBListener (Listener &listener) :
m_opaque_ptr (&listener),
m_opaque_ptr_owned (false)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBListener::SBListener (Listener &listener) *listener = %p ==> this = %p (m_opaque_ptr = %p)",
&listener, this, m_opaque_ptr);
log->Printf ("SBListener::SBListener (listener=%p) => this.obj = %p",
&listener, m_opaque_ptr);
}
SBListener::~SBListener ()
@ -91,11 +87,11 @@ SBListener::StartListeningForEvents (const SBBroadcaster& broadcaster, uint32_t
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
log->Printf ("SBListener::StartListeningForEvents (const SBBroadcaster &broadcaster, uint32_t event_mask)"
" &broadcaster = %p, event_mask = %d", &broadcaster, event_mask);
}
//if (log)
//{
// log->Printf ("SBListener::StartListeningForEvents (const SBBroadcaster &broadcaster, uint32_t event_mask)"
// " &broadcaster = %p, event_mask = %d", &broadcaster, event_mask);
//}
uint32_t ret_value = 0;
if (m_opaque_ptr && broadcaster.IsValid())
@ -104,7 +100,8 @@ SBListener::StartListeningForEvents (const SBBroadcaster& broadcaster, uint32_t
}
if (log)
log->Printf ("SBListener::StartListeneingForEvents ==> %d", ret_value);
log->Printf ("SBListener::StartListeneingForEvents (this.obj=%p, broadcaster.obj=%p, event_mask=%d) => %d",
m_opaque_ptr, broadcaster.get(), event_mask, ret_value);
return ret_value;
}
@ -124,12 +121,12 @@ SBListener::WaitForEvent (uint32_t num_seconds, SBEvent &event)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
SBStream sstr;
event.GetDescription (sstr);
log->Printf ("SBListener::WaitForEvent (%d, %s)", num_seconds, sstr.GetData());
}
//if (log)
//{
// SBStream sstr;
// event.GetDescription (sstr);
// log->Printf ("SBListener::WaitForEvent (%d, %s)", num_seconds, sstr.GetData());
//}
if (m_opaque_ptr)
{
@ -145,13 +142,15 @@ SBListener::WaitForEvent (uint32_t num_seconds, SBEvent &event)
{
event.reset (event_sp);
if (log)
log->Printf ("SBListener::WaitForEvent ==> true");
log->Printf ("SBListener::WaitForEvent (this.obj=%p, num_seconds=%d, event.sp=%p) => 'true'",
m_opaque_ptr, num_seconds, event.get());
return true;
}
}
if (log)
log->Printf ("SBListener::WaitForEvent ==> false");
log->Printf ("SBListener::WaitForEvent (this.obj=%p, num_seconds=%d, event.sp=%p) => 'false'",
m_opaque_ptr, num_seconds, event.get());
event.reset (NULL);
return false;

View File

@ -23,20 +23,15 @@ using namespace lldb_private;
SBModule::SBModule () :
m_opaque_sp ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBModule::SBModule () ==> this = %p", this);
}
SBModule::SBModule (const lldb::ModuleSP& module_sp) :
m_opaque_sp (module_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBModule::SBModule (const lldb::ModuleSP &module_sp) module_sp.get() = %p ==> this = %p",
module_sp.get(), this);
log->Printf ("SBModule::SBModule (module_sp=%p) => this.sp = %p", module_sp.get(), m_opaque_sp.get());
}
SBModule::~SBModule ()
@ -54,8 +49,8 @@ SBModule::GetFileSpec () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBModule::GetFileSpec ()");
//if (log)
// log->Printf ("SBModule::GetFileSpec ()");
SBFileSpec file_spec;
if (m_opaque_sp)
@ -65,7 +60,8 @@ SBModule::GetFileSpec () const
{
SBStream sstr;
file_spec.GetDescription (sstr);
log->Printf ("SBModule::GetFileSpec ==> SBFileSpec (this = %p, 's')", &file_spec, sstr.GetData());
log->Printf ("SBModule::GetFileSpec (this.sp=%p) => SBFileSpec : this.ap = %p, 's'", m_opaque_sp.get(),
file_spec.get(), sstr.GetData());
}
return file_spec;
@ -76,8 +72,8 @@ SBModule::GetUUIDBytes () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBModule::GetUUIDBytes ()");
//if (log)
// log->Printf ("SBModule::GetUUIDBytes ()");
if (m_opaque_sp)
{
@ -85,13 +81,13 @@ SBModule::GetUUIDBytes () const
{
StreamString sstr;
m_opaque_sp->GetUUID().Dump (&sstr);
log->Printf ("SBModule::GetUUIDBytes ==> '%s'", sstr.GetData());
log->Printf ("SBModule::GetUUIDBytes (this.sp=%p) => '%s'", m_opaque_sp.get(), sstr.GetData());
}
return (const uint8_t *)m_opaque_sp->GetUUID().GetBytes();
}
if (log)
log->Printf ("SBModule::GetUUIDBytes ==> NULL");
log->Printf ("SBModule::GetUUIDBytes (this.sp=%p) => NULL", m_opaque_sp.get());
return NULL;
}

View File

@ -43,10 +43,6 @@ using namespace lldb_private;
SBProcess::SBProcess () :
m_opaque_sp()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBProcess::SBProcess () ==> this = %p", this);
}
@ -57,22 +53,20 @@ SBProcess::SBProcess () :
SBProcess::SBProcess (const SBProcess& rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::SBProcess (const SBProcess &rhs) rhs.m_opaque_sp.get() = %p ==> this = %p",
rhs.m_opaque_sp.get(), this);
log->Printf ("SBProcess::SBProcess (rhs.sp=%p) => this.sp = %p", rhs.m_opaque_sp.get(), m_opaque_sp.get());
}
SBProcess::SBProcess (const lldb::ProcessSP &process_sp) :
m_opaque_sp (process_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::SBProcess (const lldb::ProcessSP &process_sp) process_sp.get() = %p ==> this = %p",
process_sp.get(), this);
log->Printf ("SBProcess::SBProcess (process_sp=%p) => this.sp = %p", process_sp.get(), m_opaque_sp.get());
}
//----------------------------------------------------------------------
@ -107,8 +101,8 @@ SBProcess::GetNumThreads ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetNumThreads ()");
//if (log)
// log->Printf ("SBProcess::GetNumThreads ()");
uint32_t num_threads = 0;
if (m_opaque_sp)
@ -118,7 +112,7 @@ SBProcess::GetNumThreads ()
}
if (log)
log->Printf ("SBProcess::GetNumThreads ==> %d", num_threads);
log->Printf ("SBProcess::GetNumThreads (this.sp=%p) => %d", m_opaque_sp.get(), num_threads);
return num_threads;
}
@ -128,8 +122,8 @@ SBProcess::GetSelectedThread () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetSelectedThread ()");
//if (log)
// log->Printf ("SBProcess::GetSelectedThread ()");
SBThread sb_thread;
if (m_opaque_sp)
@ -139,7 +133,8 @@ SBProcess::GetSelectedThread () const
{
SBStream sstr;
sb_thread.GetDescription (sstr);
log->Printf ("SBProcess::GetSelectedThread ==> SBThread (this = %p, '%s')", &sb_thread, sstr.GetData());
log->Printf ("SBProcess::GetSelectedThread (this.sp=%p) => SBThread : this = %p, '%s'", m_opaque_sp.get(),
&sb_thread, sstr.GetData());
}
return sb_thread;
@ -150,15 +145,15 @@ SBProcess::GetTarget() const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetTarget ()");
//if (log)
// log->Printf ("SBProcess::GetTarget ()");
SBTarget sb_target;
if (m_opaque_sp)
sb_target = m_opaque_sp->GetTarget().GetSP();
if (log)
log->Printf ("SBProcess::GetTarget ==> SBTarget (this = %p, m_opaque_sp.get())", &sb_target,
log->Printf ("SBProcess::GetTarget (this.sp=%p) => SBTarget (this.sp = %p)", m_opaque_sp.get(),
sb_target.get());
return sb_target;
@ -170,8 +165,8 @@ SBProcess::PutSTDIN (const char *src, size_t src_len)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::PutSTDIN (%s, %d)", src, src_len);
//if (log)
// log->Printf ("SBProcess::PutSTDIN (%s, %d)", src, src_len);
size_t ret_val = 0;
if (m_opaque_sp != NULL)
@ -181,7 +176,8 @@ SBProcess::PutSTDIN (const char *src, size_t src_len)
}
if (log)
log->Printf ("SBProcess::PutSTDIN ==> %d", ret_val);
log->Printf ("SBProcess::PutSTDIN (this.sp=%p, src='%s', src_len=%d) => %d", m_opaque_sp.get(), src,
(uint32_t) src_len, ret_val);
return ret_val;
}
@ -191,8 +187,8 @@ SBProcess::GetSTDOUT (char *dst, size_t dst_len) const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetSTDOUT (char *dst, size_t dst_Len)");
//if (log)
// log->Printf ("SBProcess::GetSTDOUT (char *dst, size_t dst_Len)");
size_t ret_val = 0;
if (m_opaque_sp != NULL)
@ -202,7 +198,8 @@ SBProcess::GetSTDOUT (char *dst, size_t dst_len) const
}
if (log)
log->Printf ("SBProcess::GetSTDOUT ==> %d", ret_val);
log->Printf ("SBProcess::GetSTDOUT (this.sp=%p, dst='%s', dst_len=%d) => %d", m_opaque_sp.get(), dst,
(uint32_t) dst_len, (uint32_t) ret_val);
return ret_val;
}
@ -212,8 +209,8 @@ SBProcess::GetSTDERR (char *dst, size_t dst_len) const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetSTDERR (char *dst, size_t dst_len)");
//if (log)
// log->Printf ("SBProcess::GetSTDERR (char *dst, size_t dst_len)");
size_t ret_val = 0;
if (m_opaque_sp != NULL)
@ -223,7 +220,8 @@ SBProcess::GetSTDERR (char *dst, size_t dst_len) const
}
if (log)
log->Printf ("SBProcess::GetSTDERR ==> %d", ret_val);
log->Printf ("SBProcess::GetSTDERR (this.sp=%p, dst='%s', dst_len=%d) => %d", m_opaque_sp.get(), dst,
(uint32_t) dst_len, (uint32_t) ret_val);
return ret_val;
}
@ -279,15 +277,16 @@ SBProcess::SetSelectedThreadByID (uint32_t tid)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::SetSelectedThreadByID (%d)", tid);
//if (log)
// log->Printf ("SBProcess::SetSelectedThreadByID (%d)", tid);
bool ret_val = false;
if (m_opaque_sp != NULL)
ret_val = m_opaque_sp->GetThreadList().SetSelectedThreadByID (tid);
if (log)
log->Printf ("SBProcess::SetSelectedThreadByID ==> %s", (ret_val ? "true" : "false"));
log->Printf ("SBProcess::SetSelectedThreadByID (this.sp=%p, tid=%d) => '%s'", m_opaque_sp.get(),
tid, (ret_val ? "true" : "false"));
return ret_val;
}
@ -297,8 +296,8 @@ SBProcess::GetThreadAtIndex (size_t index)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetThreadAtIndex (%d)");
//if (log)
// log->Printf ("SBProcess::GetThreadAtIndex (%d)");
SBThread thread;
if (m_opaque_sp)
@ -308,7 +307,8 @@ SBProcess::GetThreadAtIndex (size_t index)
{
SBStream sstr;
thread.GetDescription (sstr);
log->Printf ("SBProcess::GetThreadAtIndex ==> SBThread (this = %p, '%s')", &thread, sstr.GetData());
log->Printf ("SBProcess::GetThreadAtIndex (this.sp=%p, index=%d) => SBThread : this.sp = %p, '%s'",
m_opaque_sp.get(), (uint32_t) index, thread.GetLLDBObjectPtr(), sstr.GetData());
}
return thread;
@ -319,15 +319,16 @@ SBProcess::GetState ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetState ()");
//if (log)
// log->Printf ("SBProcess::GetState ()");
StateType ret_val = eStateInvalid;
if (m_opaque_sp != NULL)
ret_val = m_opaque_sp->GetState();
if (log)
log->Printf ("SBProcess::GetState ==> %s", lldb_private::StateAsCString (ret_val));
log->Printf ("SBProcess::GetState (this.sp=%p) => '%s'", m_opaque_sp.get(),
lldb_private::StateAsCString (ret_val));
return ret_val;
}
@ -356,15 +357,15 @@ SBProcess::GetProcessID ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetProcessID ()");
//if (log)
// log->Printf ("SBProcess::GetProcessID ()");
lldb::pid_t ret_val = LLDB_INVALID_PROCESS_ID;
if (m_opaque_sp)
ret_val = m_opaque_sp->GetID();
if (log)
log->Printf ("SBProcess::GetProcessID ==> %d", ret_val);
log->Printf ("SBProcess::GetProcessID (this.sp=%p) => %d", m_opaque_sp.get(), ret_val);
return ret_val;
}
@ -374,15 +375,15 @@ SBProcess::GetAddressByteSize () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetAddressByteSize()");
//if (log)
// log->Printf ("SBProcess::GetAddressByteSize()");
uint32_t size = 0;
if (m_opaque_sp)
size = m_opaque_sp->GetAddressByteSize();
if (log)
log->Printf ("SBProcess::GetAddressByteSize ==> %d", size);
log->Printf ("SBProcess::GetAddressByteSize (this.sp=%p) => %d", m_opaque_sp.get(), size);
return size;
}
@ -413,8 +414,8 @@ SBProcess::Continue ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::Continue ()");
//if (log)
// log->Printf ("SBProcess::Continue ()");
SBError sb_error;
if (IsValid())
@ -434,7 +435,8 @@ SBProcess::Continue ()
{
SBStream sstr;
sb_error.GetDescription (sstr);
log->Printf ("SBProcess::Continue ==> SBError (this = %p, '%s')", &sb_error, sstr.GetData());
log->Printf ("SBProcess::Continue (this.sp=%p) => SBError (this.ap = %p, '%s')", m_opaque_sp.get(),
sb_error.get(), sstr.GetData());
}
return sb_error;
@ -459,8 +461,8 @@ SBProcess::Stop ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::Stop ()");
//if (log)
// log->Printf ("SBProcess::Stop ()");
SBError sb_error;
if (IsValid())
@ -472,7 +474,8 @@ SBProcess::Stop ()
{
SBStream sstr;
sb_error.GetDescription (sstr);
log->Printf ("SBProcess::Stop ==> SBError (this = %p, '%s')", &sb_error, sstr.GetData());
log->Printf ("SBProcess::Stop (this.sp=%p) => SBError (this.ap = %p, '%s')", m_opaque_sp.get(), sb_error.get(),
sstr.GetData());
}
return sb_error;
@ -483,8 +486,8 @@ SBProcess::Kill ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::Kill ()");
//if (log)
// log->Printf ("SBProcess::Kill ()");
SBError sb_error;
if (m_opaque_sp)
@ -496,7 +499,8 @@ SBProcess::Kill ()
{
SBStream sstr;
sb_error.GetDescription (sstr);
log->Printf ("SBProcess::Kill ==> SBError (this = %p,'%s')", &sb_error, sstr.GetData());
log->Printf ("SBProcess::Kill (this.sp=%p) => SBError (this.ap = %p,'%s')", m_opaque_sp.get(), sb_error.get(),
sstr.GetData());
}
return sb_error;
@ -570,17 +574,18 @@ SBProcess::GetStateFromEvent (const SBEvent &event)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
SBStream sstr;
event.GetDescription (sstr);
log->Printf ("SBProcess::GetStateFromEvent (%s)", sstr.GetData());
}
//if (log)
//{
// SBStream sstr;
// event.GetDescription (sstr);
// log->Printf ("SBProcess::GetStateFromEvent (%s)", sstr.GetData());
//}
StateType ret_val = Process::ProcessEventData::GetStateFromEvent (event.get());
if (log)
log->Printf ("SBProcess::GetStateFromEvent ==> %s", lldb_private::StateAsCString (ret_val));
log->Printf ("SBProcess::GetStateFromEvent (event.sp=%p) => '%s'", event.get(),
lldb_private::StateAsCString (ret_val));
return ret_val;
}
@ -604,13 +609,14 @@ SBProcess::GetBroadcaster () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::GetBroadcaster ()");
//if (log)
// log->Printf ("SBProcess::GetBroadcaster ()");
SBBroadcaster broadcaster(m_opaque_sp.get(), false);
if (log)
log->Printf ("SBProcess::GetBroadcaster ==> SBBroadcaster (this = %p, m_opaque = %p)", &broadcaster,
m_opaque_sp.get());
log->Printf ("SBProcess::GetBroadcaster (this.sp=%p) => SBBroadcaster (this.obj = %p)", m_opaque_sp.get(),
broadcaster.get());
return broadcaster;
}
@ -626,8 +632,8 @@ SBProcess::ReadMemory (addr_t addr, void *dst, size_t dst_len, SBError &sb_error
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess::ReadMemory (%p, %p, %d, sb_error)", addr, dst, dst_len);
//if (log)
// log->Printf ("SBProcess::ReadMemory (%p, %p, %d, sb_error)", addr, dst, dst_len);
size_t bytes_read = 0;
@ -643,7 +649,8 @@ SBProcess::ReadMemory (addr_t addr, void *dst, size_t dst_len, SBError &sb_error
}
if (log)
log->Printf ("SBProcess::ReadMemory ==> %d", bytes_read);
log->Printf ("SBProcess::ReadMemory (this.sp=%p, addr=%p, dst=%p, dst_len=%d, sb_error.ap=%p) => %d",
m_opaque_sp.get(), addr, dst, (uint32_t) dst_len, sb_error.get(), (uint32_t) bytes_read);
return bytes_read;
}

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

View File

@ -20,16 +20,12 @@ using namespace lldb_private;
SBSymbolContext::SBSymbolContext () :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBSymbolContext::SBSymbolContext () ==> this = %p", this);
}
SBSymbolContext::SBSymbolContext (const SymbolContext *sc_ptr) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (sc_ptr)
m_opaque_ap.reset (new SymbolContext (*sc_ptr));
@ -38,19 +34,16 @@ SBSymbolContext::SBSymbolContext (const SymbolContext *sc_ptr) :
{
SBStream sstr;
GetDescription (sstr);
log->Printf ("SBSymbolContext::SBSymcolContext (const SymbolContext *sc_ptr) sc_ptr = %p ==> this = %p (%s)",
sc_ptr, this, sstr.GetData());
log->Printf ("SBSymbolContext::SBSymcolContext (sc_ptr=%p) => this.ap = %p (%s)",
sc_ptr, m_opaque_ap.get(), sstr.GetData());
}
}
SBSymbolContext::SBSymbolContext (const SBSymbolContext& rhs) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBSymbolContext::SBSymcolContext (const SBSymbolContext &rhs) rhs.m_opaque_ap.get() = %p "
"==> this = %p", (rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), this);
if (rhs.IsValid())
{
@ -60,6 +53,10 @@ SBSymbolContext::SBSymbolContext (const SBSymbolContext& rhs) :
ref() = *rhs.m_opaque_ap;
}
if (log)
log->Printf ("SBSymbolContext::SBSymcolContext (rhs.ap=%p) => this.ap = %p",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), m_opaque_ap.get());
}
SBSymbolContext::~SBSymbolContext ()
@ -107,8 +104,8 @@ SBSymbolContext::GetModule ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBSymbolContext::GetModule ()");
//if (log)
// log->Printf ("SBSymbolContext::GetModule ()");
SBModule sb_module;
if (m_opaque_ap.get())
@ -118,7 +115,8 @@ SBSymbolContext::GetModule ()
{
SBStream sstr;
sb_module.GetDescription (sstr);
log->Printf ("SBSymbolContext::GetModule ==> SBModule (this = %p, '%s')", &sb_module, sstr.GetData());
log->Printf ("SBSymbolContext::GetModule (this.ap=%p) => SBModule (this.sp = %p, '%s')", m_opaque_ap.get(),
sb_module.get(), sstr.GetData());
}
return sb_module;
@ -135,14 +133,14 @@ SBSymbolContext::GetFunction ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBSymbolContext::GetFunction ()");
//if (log)
// log->Printf ("SBSymbolContext::GetFunction ()");
SBFunction ret_function (m_opaque_ap.get() ? m_opaque_ap->function : NULL);
if (log)
log->Printf ("SBSymbolContext::GetFunction ==> SBFunction (this = %p, '%s')", &ret_function,
ret_function.GetName());
log->Printf ("SBSymbolContext::GetFunction (this.ap=%p) => SBFunction (this.obj = %p, '%s')",
m_opaque_ap.get(), ret_function.get(), ret_function.GetName());
return ret_function;
}
@ -158,8 +156,8 @@ SBSymbolContext::GetLineEntry ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBSymbolContext::GetLineEntry ()");
//if (log)
// log->Printf ("SBSymbolContext::GetLineEntry ()");
SBLineEntry sb_line_entry;
if (m_opaque_ap.get())
@ -169,8 +167,9 @@ SBSymbolContext::GetLineEntry ()
{
SBStream sstr;
sb_line_entry.GetDescription (sstr);
log->Printf ("SBSymbolContext::GetLineEntry ==> SBLineEntry (this = %p, '%s')", &sb_line_entry,
sstr.GetData());
log->Printf ("SBSymbolContext::GetLineEntry (this.ap=%p) => SBLineEntry (this.ap = %p, '%s')",
m_opaque_ap.get(),
sb_line_entry.get(), sstr.GetData());
}
return sb_line_entry;
@ -181,8 +180,8 @@ SBSymbolContext::GetSymbol ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBSymbolContext::GetSymbol ()");
//if (log)
// log->Printf ("SBSymbolContext::GetSymbol ()");
SBSymbol ret_symbol (m_opaque_ap.get() ? m_opaque_ap->symbol : NULL);
@ -190,7 +189,8 @@ SBSymbolContext::GetSymbol ()
{
SBStream sstr;
ret_symbol.GetDescription (sstr);
log->Printf ("SBSymbolContext::GetSymbol ==> SBSymbol (this = %p, '%s')", &ret_symbol, sstr.GetData());
log->Printf ("SBSymbolContext::GetSymbol (this.ap=%p) => SBSymbol (this.ap = %p, '%s')", m_opaque_ap.get(),
ret_symbol.get(), sstr.GetData());
}
return ret_symbol;

View File

@ -52,30 +52,30 @@ using namespace lldb_private;
//----------------------------------------------------------------------
SBTarget::SBTarget ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBTarget::SBTarget () ==> this = %p", this);
}
SBTarget::SBTarget (const SBTarget& rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::SBTarget (const SBTarget &rhs) rhs.m_opaque_sp.get() = %p ==> this = %p",
rhs.m_opaque_sp.get(), this);
log->Printf ("SBTarget::SBTarget (rhs.sp=%p) => this.sp = %p",
rhs.m_opaque_sp.get(), m_opaque_sp.get());
}
SBTarget::SBTarget(const TargetSP& target_sp) :
m_opaque_sp (target_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::SBTarget (const TargetSP &target_sp) target_sp.get() = %p ==> this = %p",
target_sp.get(), this);
{
SBStream sstr;
GetDescription (sstr, lldb::eDescriptionLevelBrief);
log->Printf ("SBTarget::SBTarget (target_sp=%p) => this.sp = %p ('%s')",
target_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
}
const SBTarget&
@ -84,15 +84,15 @@ SBTarget::Assign (const SBTarget& rhs)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::Assign (const SBTarget &rhs) rhs = %p", &rhs);
log->Printf ("SBTarget::Assign (this.sp=%p, rhs.sp=%p)", m_opaque_sp.get(), rhs.m_opaque_sp.get());
if (this != &rhs)
{
m_opaque_sp = rhs.m_opaque_sp;
}
if (log)
log->Printf ("SBTarget::Assign ==> SBTarget (this = %p, m_opaque_sp.get() = %p)", this, m_opaque_sp.get());
//if (log)
// log->Printf ("SBTarget::Assign => SBTarget (this = %p, m_opaque_sp.get() = %p)", this, m_opaque_sp.get());
return *this;
}
@ -116,8 +116,8 @@ SBTarget::GetProcess ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::GetProcess ()");
//if (log)
// log->Printf ("SBTarget::GetProcess ()");
SBProcess sb_process;
if (m_opaque_sp)
@ -127,7 +127,8 @@ SBTarget::GetProcess ()
{
SBStream sstr;
sb_process.GetDescription (sstr);
log->Printf ("SBTarget::GetProcess ==> SBProcess (this = %p, '%s')", &sb_process, sstr.GetData());
log->Printf ("SBTarget::GetProcess (this.sp=%p) => SBProcess : this.sp = %p, '%s'", m_opaque_sp.get(),
sb_process.get(), sstr.GetData());
}
return sb_process;
@ -149,8 +150,8 @@ SBTarget::CreateProcess ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::CreateProcess ()");
//if (log)
// log->Printf ("SBTarget::CreateProcess ()");
SBProcess sb_process;
@ -161,7 +162,8 @@ SBTarget::CreateProcess ()
{
SBStream sstr;
sb_process.GetDescription (sstr);
log->Printf ("SBTarget::CreateProcess ==> SBProcess (this = %p, '%s')", &sb_process, sstr.GetData());
log->Printf ("SBTarget::CreateProcess (this.sp=%p) => SBProcess this.sp = %p, '%s'", m_opaque_sp.get(),
sb_process.get(), sstr.GetData());
}
return sb_process;
@ -181,30 +183,9 @@ SBTarget::LaunchProcess
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
log->Printf ("SBTarget::LaunchProcess (char const **argv, char const **envp, const char *tty, "
"uint32_t launch_flags, bool stop_at_entry)");
if (!argv)
log->Printf ("argv: NULL");
else
{
for (int i = 0; argv[i]; ++i)
log->Printf (" %s", argv[i]);
}
if (!envp)
log->Printf ("envp: NULL");
else
{
for (int i = 0; envp[i]; ++i)
log->Printf (" %s", envp[i]);
}
log->Printf (" tty = %s, launch_flags = %d, stop_at_entry = %s", tty, launch_flags, (stop_at_entry ?
"true" :
"false"));
}
log->Printf ("SBTarget::LaunchProcess (this.sp=%p, argv=%p, envp=%p, tty='%s', launch_flags=%d, "
"stop_at_entry='%s')",
m_opaque_sp.get(), argv, envp, tty, launch_flags, (stop_at_entry ? "true" : "false"));
SBError sb_error;
SBProcess sb_process = Launch (argv, envp, tty, launch_flags, stop_at_entry, sb_error);
@ -213,7 +194,8 @@ SBTarget::LaunchProcess
{
SBStream sstr;
sb_process.GetDescription (sstr);
log->Printf ("SBTarget::LaunchProcess ==> SBProcess (this = %p, '%s')", this, sstr.GetData());
log->Printf ("SBTarget::LaunchProcess (this.sp=%p, ...) => SBProcess : this.sp = %p, '%s'", m_opaque_sp.get(),
sb_process.get(), sstr.GetData());
}
return sb_process;
@ -233,28 +215,10 @@ SBTarget::Launch
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
log->Printf ("SBTarget::Launch (char const **argv, char const **envp, const char *tty, uint32_t launch_flag,"
"bool stop_at_entry, SBError error)");
if (!argv)
log->Printf ("argv: NULL");
else
{
for (int i = 0; argv[i]; ++i)
log->Printf (" %s", argv[i]);
}
if (!envp)
log->Printf ("envp: NULL");
else
{
for (int i = 0; envp[i]; ++i)
log->Printf (" %s", envp[i]);
}
log->Printf (" tty = %s, launch_flags = %d, stop_at_entry = %s, error (this = %p)", tty, launch_flags,
(stop_at_entry ? "true" : "false"), &error);
}
log->Printf ("SBTarget::Launch (this.sp=%p, argv=%p, envp=%p, tty='%s', launch_flags=%d, stop_at_entry=%s, "
"error.ap=%p)",
m_opaque_sp.get(), argv, envp, tty, launch_flags, (stop_at_entry ? "true" : "false"),
error.get());
SBProcess sb_process;
if (m_opaque_sp)
@ -310,7 +274,8 @@ SBTarget::Launch
{
SBStream sstr;
sb_process.GetDescription (sstr);
log->Printf ("SBTarget::Launch ==> SBProceess (this = %p, '%s')", &sb_process, sstr.GetData());
log->Printf ("SBTarget::Launch (this.sp=%p, ...) => SBProceess : this.sp = %p, '%s'", m_opaque_sp.get(),
sb_process.get(), sstr.GetData());
}
return sb_process;
@ -401,8 +366,8 @@ SBTarget::GetExecutable ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::GetExecutable ()");
//if (log)
// log->Printf ("SBTarget::GetExecutable ()");
SBFileSpec exe_file_spec;
if (m_opaque_sp)
@ -418,11 +383,12 @@ SBTarget::GetExecutable ()
{
SBStream sstr;
exe_file_spec.GetDescription (sstr);
log->Printf ("SBTarget::GetExecutable ==> SBFileSpec (this = %p, '%s')", &exe_file_spec, sstr.GetData());
log->Printf ("SBTarget::GetExecutable (this.sp=%p) => SBFileSpec (this.ap = %p, '%s')", m_opaque_sp.get(),
exe_file_spec.get(), sstr.GetData());
}
else
log->Printf ("SBTarget::GetExecutable ==> SBFileSpec (this = %p, 'Unable to find valid file')",
&exe_file_spec);
log->Printf ("SBTarget::GetExecutable (this.sp=%p) => SBFileSpec (this.ap = %p, 'Unable to find valid file')",
m_opaque_sp.get(), exe_file_spec.get());
}
return exe_file_spec;
@ -473,9 +439,9 @@ SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line) file = '%s', line = %d",
file, line);
//if (log)
// log->Printf ("SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line) file = '%s', line = %d",
// file, line);
SBBreakpoint sb_bp;
if (file != NULL && line != 0)
@ -485,7 +451,8 @@ SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line)
{
SBStream sstr;
sb_bp.GetDescription (sstr);
log->Printf("SBTarget::BreakpointCreateByLocation ==> SBBreakpoint (this = %p, '%s')", &sb_bp, sstr.GetData());
log->Printf("SBTarget::BreakpointCreateByLocation (this.sp=%p, file='%s', line=%d) => "
"SBBreakpoint : this.sp = %p, '%s'", m_opaque_sp.get(), file, line, sb_bp.get(), sstr.GetData());
}
return sb_bp;
@ -496,9 +463,9 @@ SBTarget::BreakpointCreateByLocation (const SBFileSpec &sb_file_spec, uint32_t l
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::BreakpointCreateByLocation (const SBFileSpec &sb_file_spec, uint32_t line) "
"sb_file_spec (%p), line = %d)", &sb_file_spec, line);
//if (log)
// log->Printf ("SBTarget::BreakpointCreateByLocation (const SBFileSpec &sb_file_spec, uint32_t line) "
// "sb_file_spec (%p), line = %d)", &sb_file_spec, line);
SBBreakpoint sb_bp;
if (m_opaque_sp.get() && line != 0)
@ -508,7 +475,8 @@ SBTarget::BreakpointCreateByLocation (const SBFileSpec &sb_file_spec, uint32_t l
{
SBStream sstr;
sb_bp.GetDescription (sstr);
log->Printf ("SBTarget::BreakpointCreateByLocation ==> SBBreakpoint (this = %p, '%s')", &sb_bp,
log->Printf ("SBTarget::BreakpointCreateByLocation (this.sp=%p, sb_file_spec.ap=%p, line=%d) => "
"SBBreakpoint : this.sp = %p, '%s'", m_opaque_sp.get(), sb_file_spec.get(), line, sb_bp.get(),
sstr.GetData());
}
@ -520,9 +488,9 @@ SBTarget::BreakpointCreateByName (const char *symbol_name, const char *module_na
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::BreakpointCreateByName (const char *symbol_name, const char *module_name) "
"symbol_name = %s, module_name = %s)", symbol_name, module_name);
//if (log)
// log->Printf ("SBTarget::BreakpointCreateByName (const char *symbol_name, const char *module_name) "
// "symbol_name = %s, module_name = %s)", symbol_name, module_name);
SBBreakpoint sb_bp;
if (m_opaque_sp.get() && symbol_name && symbol_name[0])
@ -542,7 +510,9 @@ SBTarget::BreakpointCreateByName (const char *symbol_name, const char *module_na
{
SBStream sstr;
sb_bp.GetDescription (sstr);
log->Printf ("SBTarget::BreakpointCreateByName ==> SBBreakpoint (this = %p, '%s')", &sb_bp, sstr.GetData());
log->Printf ("SBTarget::BreakpointCreateByName (this.sp=%p, symbol_name='%s', module_name='%s') => "
"SBBreakpoint : this.sp = %p, '%s'", m_opaque_sp.get(), symbol_name, module_name, sb_bp.get(),
sstr.GetData());
}
return sb_bp;
@ -553,9 +523,9 @@ SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, const char *mo
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, const char *module_name) "
"symbol_name_regex = %s, module_name = %s)", symbol_name_regex, module_name);
//if (log)
// log->Printf ("SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, const char *module_name) "
// "symbol_name_regex = %s, module_name = %s)", symbol_name_regex, module_name);
SBBreakpoint sb_bp;
if (m_opaque_sp.get() && symbol_name_regex && symbol_name_regex[0])
@ -578,7 +548,9 @@ SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, const char *mo
{
SBStream sstr;
sb_bp.GetDescription (sstr);
log->Printf ("SBTarget::BreakpointCreateByRegex ==> SBBreakpoint (this = %p, '%s')", &sb_bp, sstr.GetData());
log->Printf ("SBTarget::BreakpointCreateByRegex (this.sp=%p, symbol_name_regex='%s', module_name='%s') "
"=> SBBreakpoint : this.sp = %p, '%s'", m_opaque_sp.get(), symbol_name_regex, module_name,
sb_bp.get(), sstr.GetData());
}
return sb_bp;
@ -591,8 +563,8 @@ SBTarget::BreakpointCreateByAddress (addr_t address)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::BreakpointCreateByAddress (addr_t address) address = %p", address);
//if (log)
// log->Printf ("SBTarget::BreakpointCreateByAddress (addr_t address) address = %p", address);
SBBreakpoint sb_bp;
if (m_opaque_sp.get())
@ -602,7 +574,8 @@ SBTarget::BreakpointCreateByAddress (addr_t address)
{
SBStream sstr;
sb_bp.GetDescription (sstr);
log->Printf ("SBTarget::BreakpointCreateByAddress ==> SBBreakpoint (this = %p, '%s')", &sb_bp, sstr.GetData());
log->Printf ("SBTarget::BreakpointCreateByAddress (this.sp=%p, address=%p) => "
"SBBreakpoint : this.sp = %p, '%s')", m_opaque_sp.get(), address, sb_bp.get(), sstr.GetData());
}
return sb_bp;
@ -613,8 +586,8 @@ SBTarget::FindBreakpointByID (break_id_t bp_id)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::FindBreakpointByID (break_id_t bp_id) bp_id = %d", bp_id);
//if (log)
// log->Printf ("SBTarget::FindBreakpointByID (break_id_t bp_id) bp_id = %d", bp_id);
SBBreakpoint sb_breakpoint;
if (m_opaque_sp && bp_id != LLDB_INVALID_BREAK_ID)
@ -624,7 +597,8 @@ SBTarget::FindBreakpointByID (break_id_t bp_id)
{
SBStream sstr;
sb_breakpoint.GetDescription (sstr);
log->Printf ("SBTarget::FindBreakpointByID ==> SBBreakpoint (this = %p, '%s'", &bp_id, sstr.GetData());
log->Printf ("SBTarget::FindBreakpointByID (this.sp=%p, bp_id=%d) => SBBreakpoint : this.sp = %p, '%s'",
m_opaque_sp.get(), (uint32_t) bp_id, sb_breakpoint.get(), sstr.GetData());
}
return sb_breakpoint;
@ -652,8 +626,8 @@ SBTarget::BreakpointDelete (break_id_t bp_id)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::BreakpointDelete (break_id_t bp_id) bp_id = %d", bp_id);
//if (log)
// log->Printf ("SBTarget::BreakpointDelete (break_id_t bp_id) bp_id = %d", bp_id);
bool result = false;
if (m_opaque_sp)
@ -662,9 +636,11 @@ SBTarget::BreakpointDelete (break_id_t bp_id)
if (log)
{
if (result)
log->Printf ("SBTarget::BreakpointDelete ==> true");
log->Printf ("SBTarget::BreakpointDelete (this.sp=%p, bp_id=%d) => 'true'", m_opaque_sp.get(),
(uint32_t) bp_id);
else
log->Printf ("SBTarget::BreakpointDelete ==> false");
log->Printf ("SBTarget::BreakpointDelete (this.sp=%p, bp_id=%d) => 'false'", m_opaque_sp.get(),
(uint32_t) bp_id);
}
return result;
@ -709,15 +685,15 @@ SBTarget::GetNumModules () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::GetNumModules ()");
//if (log)
// log->Printf ("SBTarget::GetNumModules ()");
uint32_t num = 0;
if (m_opaque_sp)
num = m_opaque_sp->GetImages().GetSize();
if (log)
log->Printf ("SBTarget::GetNumModules ==> %d", num);
log->Printf ("SBTarget::GetNumModules (this.sp=%p) => %d", m_opaque_sp.get(), num);
return num;
}
@ -728,7 +704,7 @@ SBTarget::Clear ()
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::Clear ()");
log->Printf ("SBTarget::Clear (this.sp=%p)", m_opaque_sp.get());
m_opaque_sp.reset();
}
@ -748,8 +724,8 @@ SBTarget::GetModuleAtIndex (uint32_t idx)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::GetModuleAtIndex (uint32_t idx) idx = %d", idx);
//if (log)
// log->Printf ("SBTarget::GetModuleAtIndex (uint32_t idx) idx = %d", idx);
SBModule sb_module;
if (m_opaque_sp)
@ -759,7 +735,8 @@ SBTarget::GetModuleAtIndex (uint32_t idx)
{
SBStream sstr;
sb_module.GetDescription (sstr);
log->Printf ("SBTarget::GetModuleAtIndex ==> SBModule: this = %p, %s", &sb_module, sstr.GetData());
log->Printf ("SBTarget::GetModuleAtIndex (this.sp=%p, idx=%d) => SBModule: this = %p, '%s'",
m_opaque_sp.get(), idx, sb_module.get(), sstr.GetData());
}
return sb_module;
@ -771,13 +748,14 @@ SBTarget::GetBroadcaster () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBTarget::GetBroadcaster ()");
//if (log)
// log->Printf ("SBTarget::GetBroadcaster ()");
SBBroadcaster broadcaster(m_opaque_sp.get(), false);
if (log)
log->Printf ("SBTarget::GetBroadcaster ==> SBBroadcaster (this = %p)", &broadcaster);
log->Printf ("SBTarget::GetBroadcaster (this.sp=%p) => SBBroadcaster (this.obj = %p)",
m_opaque_sp.get(), broadcaster.get());
return broadcaster;
}

View File

@ -41,10 +41,6 @@ using namespace lldb_private;
SBThread::SBThread () :
m_opaque_sp ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBThread::SBThread () ==> this = %p", this);
}
//----------------------------------------------------------------------
@ -53,22 +49,27 @@ SBThread::SBThread () :
SBThread::SBThread (const ThreadSP& lldb_object_sp) :
m_opaque_sp (lldb_object_sp)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::SBThread (const ThreadSP &lldb_object_sp) lldb_object_sp.get() = %p ==> this = %p",
lldb_object_sp.get(), this);
{
SBStream sstr;
GetDescription (sstr);
log->Printf ("SBThread::SBThread (lldb_object_sp=%p) => this.sp = %p (%s)",
lldb_object_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
}
SBThread::SBThread (const SBThread &rhs)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBThread::SBThread (const SBThread &rhs) rhs.m_opaque_sp.get() = %p ==> this = %p",
rhs.m_opaque_sp.get(), this);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
m_opaque_sp = rhs.m_opaque_sp;
if (log)
log->Printf ("SBThread::SBThread (rhs.sp=%p) => this.sp = %p",
rhs.m_opaque_sp.get(), m_opaque_sp.get());
}
//----------------------------------------------------------------------
@ -96,8 +97,8 @@ SBThread::GetStopReason()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::GetStopReason ()");
//if (log)
// log->Printf ("SBThread::GetStopReason ()");
StopReason reason = eStopReasonInvalid;
if (m_opaque_sp)
@ -108,7 +109,8 @@ SBThread::GetStopReason()
}
if (log)
log->Printf ("SBThread::GetStopReason ==> %s", Thread::StopReasonAsCString (reason));
log->Printf ("SBThread::GetStopReason (this.sp=%p) => '%s'", m_opaque_sp.get(),
Thread::StopReasonAsCString (reason));
return reason;
}
@ -118,8 +120,8 @@ SBThread::GetStopDescription (char *dst, size_t dst_len)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::GetStopDescription (char *dst, size_t dst_len)");
//if (log)
// log->Printf ("SBThread::GetStopDescription (char *dst, size_t dst_len)");
if (m_opaque_sp)
{
@ -130,7 +132,8 @@ SBThread::GetStopDescription (char *dst, size_t dst_len)
if (stop_desc)
{
if (log)
log->Printf ("SBThread::GetStopDescription ==> %s", stop_desc);
log->Printf ("SBThread::GetStopDescription (this.sp=%p, dst, dst_len) => '%s'",
m_opaque_sp.get(), stop_desc);
if (dst)
return ::snprintf (dst, dst_len, "%s", stop_desc);
else
@ -196,7 +199,8 @@ SBThread::GetStopDescription (char *dst, size_t dst_len)
if (stop_desc && stop_desc[0])
{
if (log)
log->Printf ("SBThread::GetStopDescription ==> %s", stop_desc);
log->Printf ("SBThread::GetStopDescription (this.sp=%p, dst, dst_len) => '%s'",
m_opaque_sp.get(), stop_desc);
if (dst)
return ::snprintf (dst, dst_len, "%s", stop_desc) + 1; // Include the NULL byte
@ -226,15 +230,15 @@ SBThread::GetThreadID () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::GetThreadID()");
//if (log)
// log->Printf ("SBThread::GetThreadID()");
lldb::tid_t id = LLDB_INVALID_THREAD_ID;
if (m_opaque_sp)
id = m_opaque_sp->GetID();
if (log)
log->Printf ("SBThread::GetThreadID ==> %d", id);
log->Printf ("SBThread::GetThreadID (this.sp=%p) => %d", m_opaque_sp.get(), (uint32_t) id);
return id;
}
@ -251,18 +255,18 @@ SBThread::GetName () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::GetName ()");
//if (log)
// log->Printf ("SBThread::GetName ()");
if (m_opaque_sp)
{
if (log)
log->Printf ("SBThread::GetName ==> %s", m_opaque_sp->GetName());
log->Printf ("SBThread::GetName (this.sp=%p) => '%s'", m_opaque_sp.get(), m_opaque_sp->GetName());
return m_opaque_sp->GetName();
}
if (log)
log->Printf ("SBThread::GetName ==> NULL");
log->Printf ("SBThread::GetName (this.sp=%p) => NULL", m_opaque_sp.get());
return NULL;
}
@ -272,18 +276,19 @@ SBThread::GetQueueName () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::GetQueueName ()");
//if (log)
// log->Printf ("SBThread::GetQueueName ()");
if (m_opaque_sp)
{
if (log)
log->Printf ("SBThread::GetQueueName ==> %s", m_opaque_sp->GetQueueName());
log->Printf ("SBThread::GetQueueName (this.sp=%p) => '%s'", m_opaque_sp.get(),
m_opaque_sp->GetQueueName());
return m_opaque_sp->GetQueueName();
}
if (log)
log->Printf ("SBThread::GetQueueName ==> NULL");
log->Printf ("SBThread::GetQueueName (this.sp=%p) => NULL", m_opaque_sp.get());
return NULL;
}
@ -295,7 +300,7 @@ SBThread::StepOver (lldb::RunMode stop_other_threads)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::StepOver (lldb::RunMode stop_other_threads) stop_other_threads = %s)",
log->Printf ("SBThread::StepOver (this.sp=%p, stop_other_threads='%s')", m_opaque_sp.get(),
Thread::RunModeAsCString (stop_other_threads));
if (m_opaque_sp)
@ -344,7 +349,7 @@ SBThread::StepInto (lldb::RunMode stop_other_threads)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::StepInto (lldb::RunMode stop_other_threads) stop_other_threads =%s",
log->Printf ("SBThread::StepInto (this.sp=%p, stop_other_threads='%s')", m_opaque_sp.get(),
Thread::RunModeAsCString (stop_other_threads));
if (m_opaque_sp)
@ -391,7 +396,7 @@ SBThread::StepOut ()
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::StepOut ()");
log->Printf ("SBThread::StepOut (this.sp=%p)", m_opaque_sp.get());
if (m_opaque_sp)
{
@ -419,7 +424,8 @@ SBThread::StepInstruction (bool step_over)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::StepInstruction (bool step_over) step_over = %s", (step_over ? "true" : "false"));
log->Printf ("SBThread::StepInstruction (this.sp=%p, step_over=%s)", m_opaque_sp.get(),
(step_over ? "true" : "false"));
if (m_opaque_sp)
{
@ -443,7 +449,7 @@ SBThread::RunToAddress (lldb::addr_t addr)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::RunToAddress (lldb:;addr_t addr) addr = %p", addr);
log->Printf ("SBThread::RunToAddress (this.sp=%p, addr=%p)", m_opaque_sp.get(), addr);
if (m_opaque_sp)
{
@ -472,8 +478,8 @@ SBThread::GetProcess ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::GetProcess ()");
//if (log)
// log->Printf ("SBThread::GetProcess ()");
SBProcess process;
if (m_opaque_sp)
@ -486,7 +492,8 @@ SBThread::GetProcess ()
{
SBStream sstr;
process.GetDescription (sstr);
log->Printf ("SBThread::GetProcess ==> SBProcess (this = %p, '%s')", &process, sstr.GetData());
log->Printf ("SBThread::GetProcess (this.sp=%p) => SBProcess : this.sp = %p, '%s'", m_opaque_sp.get(),
process.get(), sstr.GetData());
}
return process;
@ -497,15 +504,15 @@ SBThread::GetNumFrames ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::GetNumFrames ()");
//if (log)
// log->Printf ("SBThread::GetNumFrames ()");
uint32_t num_frames = 0;
if (m_opaque_sp)
num_frames = m_opaque_sp->GetStackFrameCount();
if (log)
log->Printf ("SBThread::GetNumFrames ==> %d", num_frames);
log->Printf ("SBThread::GetNumFrames (this.sp=%p) => %d", m_opaque_sp.get(), num_frames);
return num_frames;
}
@ -515,8 +522,8 @@ SBThread::GetFrameAtIndex (uint32_t idx)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::GetFrameAtIndex (uint32_t idx) idx = %d", idx);
//if (log)
// log->Printf ("SBThread::GetFrameAtIndex (uint32_t idx) idx = %d", idx);
SBFrame sb_frame;
if (m_opaque_sp)
@ -526,7 +533,8 @@ SBThread::GetFrameAtIndex (uint32_t idx)
{
SBStream sstr;
sb_frame.GetDescription (sstr);
log->Printf ("SBThread::GetFrameAtIndex ==> SBFrame (this = %p, '%s')", &sb_frame, sstr.GetData());
log->Printf ("SBThread::GetFrameAtIndex (this.sp=%p, idx=%d) => SBFrame.sp : this = %p, '%s'",
m_opaque_sp.get(), idx, sb_frame.get(), sstr.GetData());
}
return sb_frame;
@ -538,9 +546,8 @@ SBThread::operator = (const lldb::SBThread &rhs)
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBThread::operator= (const lldb::SBThread &rhs) rhs.m_opaque_sp.get() = %p ==> this = %p",
rhs.m_opaque_sp.get(), this);
log->Printf ("SBThread::operator= (this.sp=%p, rhs.sp=%p)", m_opaque_sp.get(), rhs.m_opaque_sp.get());
m_opaque_sp = rhs.m_opaque_sp;
return *this;
}

View File

@ -23,13 +23,13 @@ SBType::IsPointerType (void *opaque_type)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBType::IsPointerType (%p)", opaque_type);
//if (log)
// log->Printf ("SBType::IsPointerType (%p)", opaque_type);
bool ret_value = ClangASTContext::IsPointerType (opaque_type);
if (log)
log->Printf ("SBType::IsPointerType ==> %s", (ret_value ? "true" : "false"));
log->Printf ("SBType::IsPointerType (opaque_type=%p) ==> '%s'", opaque_type, (ret_value ? "true" : "false"));
return ret_value;
}

View File

@ -37,23 +37,19 @@ using namespace lldb_private;
SBValue::SBValue () :
m_opaque_sp ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBValue::SBValue () ==> this = %p", this);
}
SBValue::SBValue (const lldb::ValueObjectSP &value_sp) :
m_opaque_sp (value_sp)
{
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 ("SBValue::SBValue (const lldb::ValueObjectSP &value_sp) value_sp.get() = %p ==> this = %p (%s)",
value_sp.get(), this, sstr.GetData());
log->Printf ("SBValue::SBValue (value_sp=%p) => this.sp = %p (%s)",
value_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
}
@ -83,19 +79,21 @@ SBValue::GetName()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBValue::GetName ()");
//if (log)
// log->Printf ("SBValue::GetName ()");
if (IsValid())
{
if (log)
log->Printf ("SBValue::GetName ==> %s", m_opaque_sp->GetName().AsCString());
log->Printf ("SBValue::GetName (this.sp=%p) => '%s'", m_opaque_sp.get(),
m_opaque_sp->GetName().AsCString());
return m_opaque_sp->GetName().AsCString();
}
else
{
if (log)
log->Printf ("SBValue::GetName ==> NULL");
log->Printf ("SBValue::GetName (this.sp=%p) ==> NULL", m_opaque_sp.get());
return NULL;
}
}

View File

@ -22,26 +22,21 @@ using namespace lldb_private;
SBValueList::SBValueList () :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBValueList::SBValueList () ==> this = %p", this);
}
SBValueList::SBValueList (const SBValueList &rhs) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBValueList::SBValueList (const SBValueList &rhs) rhs.m_opaque_ap.get() = %p ==> this = %p",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), this);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (rhs.IsValid())
m_opaque_ap.reset (new lldb_private::ValueObjectList (*rhs));
if (log)
{
log->Printf ("SBValueList::SBValueList (rhs.ap=%p) => this.ap = %p",
(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL), m_opaque_ap.get());
uint32_t num_vars = GetSize();
for (uint32_t i = 0; i < num_vars; ++i)
{
@ -56,17 +51,17 @@ SBValueList::SBValueList (const SBValueList &rhs) :
SBValueList::SBValueList (const lldb_private::ValueObjectList *lldb_object_ptr) :
m_opaque_ap ()
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
if (log)
log->Printf ("SBValueList::SBValueList (const lldb_private::ValueObjectList *lldb_object_ptr) "
"lldb_object_ptr = %p ==> this = %p", lldb_object_ptr, this);
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (lldb_object_ptr)
m_opaque_ap.reset (new lldb_private::ValueObjectList (*lldb_object_ptr));
if (log)
{
log->Printf ("SBValueList::SBValueList (lldb_object_ptr=%p) => this.ap = %p", lldb_object_ptr,
m_opaque_ap.get());
uint32_t num_vars = GetSize();
for (uint32_t i = 0; i < num_vars; ++i)
{
@ -151,8 +146,8 @@ SBValueList::GetValueAtIndex (uint32_t idx) const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBValueList::GetValueAtIndex (uint32_t idx) idx = %d", idx);
//if (log)
// log->Printf ("SBValueList::GetValueAtIndex (uint32_t idx) idx = %d", idx);
SBValue sb_value;
if (m_opaque_ap.get())
@ -162,7 +157,8 @@ SBValueList::GetValueAtIndex (uint32_t idx) const
{
SBStream sstr;
sb_value.GetDescription (sstr);
log->Printf ("SBValueList::GetValueAtIndex ==> SBValue (this = %p, '%s')", &sb_value, sstr.GetData());
log->Printf ("SBValueList::GetValueAtIndex (this.ap=%p, idx=%d) => SBValue (this.sp = %p, '%s')",
m_opaque_ap.get(), sb_value.get(), sstr.GetData());
}
return sb_value;
@ -173,15 +169,15 @@ SBValueList::GetSize () const
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBValueList::GetSize ()");
//if (log)
// log->Printf ("SBValueList::GetSize ()");
uint32_t size = 0;
if (m_opaque_ap.get())
size = m_opaque_ap->GetSize();
if (log)
log->Printf ("SBValueList::GetSize ==> %d", size);
log->Printf ("SBValueList::GetSize (this.ap=%p) => %d", m_opaque_ap.get(), size);
return size;
}
@ -203,3 +199,9 @@ SBValueList::FindValueObjectByUID (lldb::user_id_t uid)
return sb_value;
}
lldb_private::ValueObjectList *
SBValueList::get ()
{
return m_opaque_ap.get();
}