[Lldb-commits] [lldb] r117772 - in /lldb/trunk: include/lldb/API/ source/API/ source/Target/
Greg Clayton
gclayton at apple.com
Fri Oct 29 21:51:46 PDT 2010
Author: gclayton
Date: Fri Oct 29 23:51:46 2010
New Revision: 117772
URL: http://llvm.org/viewvc/llvm-project?rev=117772&view=rev
Log:
Improved API logging.
Modified:
lldb/trunk/include/lldb/API/SBBlock.h
lldb/trunk/include/lldb/API/SBFrame.h
lldb/trunk/include/lldb/API/SBProcess.h
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/include/lldb/API/SBThread.h
lldb/trunk/source/API/SBBlock.cpp
lldb/trunk/source/API/SBBreakpoint.cpp
lldb/trunk/source/API/SBCommandInterpreter.cpp
lldb/trunk/source/API/SBCommunication.cpp
lldb/trunk/source/API/SBDebugger.cpp
lldb/trunk/source/API/SBError.cpp
lldb/trunk/source/API/SBEvent.cpp
lldb/trunk/source/API/SBFileSpec.cpp
lldb/trunk/source/API/SBFrame.cpp
lldb/trunk/source/API/SBInputReader.cpp
lldb/trunk/source/API/SBListener.cpp
lldb/trunk/source/API/SBModule.cpp
lldb/trunk/source/API/SBProcess.cpp
lldb/trunk/source/API/SBSymbol.cpp
lldb/trunk/source/API/SBSymbolContext.cpp
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/API/SBThread.cpp
lldb/trunk/source/Target/Target.cpp
Modified: lldb/trunk/include/lldb/API/SBBlock.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBlock.h?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBBlock.h (original)
+++ lldb/trunk/include/lldb/API/SBBlock.h Fri Oct 29 23:51:46 2010
@@ -58,6 +58,9 @@
#ifndef SWIG
+ const lldb_private::Block *
+ get () const;
+
SBBlock (lldb_private::Block *lldb_object_ptr);
void
Modified: lldb/trunk/include/lldb/API/SBFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFrame.h?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBFrame.h (original)
+++ lldb/trunk/include/lldb/API/SBFrame.h Fri Oct 29 23:51:46 2010
@@ -124,9 +124,6 @@
protected:
friend class SBValue;
- lldb_private::StackFrame *
- GetLLDBObjectPtr ();
-
private:
friend class SBThread;
friend class lldb_private::ScriptInterpreterPython;
Modified: lldb/trunk/include/lldb/API/SBProcess.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBProcess.h?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBProcess.h (original)
+++ lldb/trunk/include/lldb/API/SBProcess.h Fri Oct 29 23:51:46 2010
@@ -106,11 +106,8 @@
SBError
Destroy ();
- bool
- WaitUntilProcessHasStopped (lldb::SBCommandReturnObject &result);
-
lldb::pid_t
- AttachByPID (lldb::pid_t pid); // DEPRECATED: will be removed in a few builds in favor of SBError AttachByPID(pid_t)
+ AttachByPID (lldb::pid_t pid); // DEPRECATED
// DEPRECATED: relocated to "SBProcess SBTarget::AttachToProcess (lldb::pid_t pid, SBError& error)"
SBError
Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Fri Oct 29 23:51:46 2010
@@ -43,9 +43,6 @@
//------------------------------------------------------------------
~SBTarget();
- const lldb::SBTarget&
- Assign (const lldb::SBTarget& rhs);
-
bool
IsValid() const;
Modified: lldb/trunk/include/lldb/API/SBThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBThread.h?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBThread.h (original)
+++ lldb/trunk/include/lldb/API/SBThread.h Fri Oct 29 23:51:46 2010
@@ -89,9 +89,6 @@
#endif
bool
- GetDescription (lldb::SBStream &description);
-
- bool
GetDescription (lldb::SBStream &description) const;
protected:
@@ -102,11 +99,12 @@
friend class SBDebugger;
friend class SBValue;
- lldb_private::Thread *
- GetLLDBObjectPtr ();
#ifndef SWIG
+ lldb_private::Thread *
+ get ();
+
const lldb_private::Thread *
operator->() const;
Modified: lldb/trunk/source/API/SBBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBlock.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBlock.cpp (original)
+++ lldb/trunk/source/API/SBBlock.cpp Fri Oct 29 23:51:46 2010
@@ -133,6 +133,12 @@
return sb_block;
}
+const lldb_private::Block *
+SBBlock::get () const
+{
+ return m_opaque_ptr;
+}
+
bool
SBBlock::GetDescription (SBStream &description)
Modified: lldb/trunk/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpoint.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpoint.cpp (original)
+++ lldb/trunk/source/API/SBBreakpoint.cpp Fri Oct 29 23:51:46 2010
@@ -72,31 +72,12 @@
SBBreakpoint::SBBreakpoint (const SBBreakpoint& rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- {
- SBStream sstr;
- GetDescription (sstr);
- log->Printf ("SBBreakpoint::SBBreakpoint (const SBBreakpoint rhs.sp=%p) "
- "=> this.sp = %p (%s)",
- rhs.m_opaque_sp.get(), m_opaque_sp.get(), sstr.GetData());
- }
}
SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp) :
m_opaque_sp (bp_sp)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- {
- SBStream sstr;
- GetDescription (sstr);
- log->Printf("SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp=%p) => this.sp = %p (%s)",
- bp_sp.get(), m_opaque_sp.get(), sstr.GetData());
- }
}
SBBreakpoint::~SBBreakpoint()
@@ -106,20 +87,8 @@
const SBBreakpoint &
SBBreakpoint::operator = (const SBBreakpoint& rhs)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //if (log)
- // log->Printf ("SBBreakpoint::operator=");
-
if (this != &rhs)
- {
m_opaque_sp = rhs.m_opaque_sp;
- }
-
- if (log)
- log->Printf ("SBBreakpoint::operator= (const SBBreakpoint &rhs.sp=%p) => this.sp = %p",
- rhs.m_opaque_sp.get(), m_opaque_sp.get());
-
return *this;
}
@@ -128,19 +97,16 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBBreakpoint::GetID");
-
if (m_opaque_sp)
{
- break_id_t id = m_opaque_sp->GetID();
+ break_id_t break_id = m_opaque_sp->GetID();
if (log)
- log->Printf ("SBBreakpoint::GetID (this.sp=%p) => %d", m_opaque_sp.get(), id);
- return id;
+ log->Printf ("SBBreakpoint(%p)::GetID () => %u", m_opaque_sp.get(), break_id);
+ return break_id;
}
if (log)
- log->Printf ("SBBreakpoint::GetID (this.sp=%p) => LLDB_INVALID_BREAK_ID", m_opaque_sp.get());
+ log->Printf ("SBBreakpoint(%p)::GetID () => LLDB_INVALID_BREAK_ID", m_opaque_sp.get());
return LLDB_INVALID_BREAK_ID;
}
@@ -232,8 +198,7 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBBreakpoint::SetEnabled (this.sp=%p, enable='%s')", m_opaque_sp.get(),
- (enable ? "true" : "false"));
+ log->Printf ("SBBreakpoint(%p)::SetEnabled (enabled=%i)", m_opaque_sp.get(), enable);
if (m_opaque_sp)
m_opaque_sp->SetEnabled (enable);
@@ -254,7 +219,7 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBBreakpoint::SetIgnoreCount (this.sp=%p, count='%d')", m_opaque_sp.get(), count);
+ log->Printf ("SBBreakpoint(%p)::SetIgnoreCount (count=%u)", m_opaque_sp.get(), count);
if (m_opaque_sp)
m_opaque_sp->SetIgnoreCount (count);
@@ -275,55 +240,61 @@
uint32_t
SBBreakpoint::GetHitCount () const
{
+ uint32_t count = 0;
+ if (m_opaque_sp)
+ count = m_opaque_sp->GetHitCount();
+
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::GetHitCount () => %u", m_opaque_sp.get(), count);
- //if (log)
- // log->Printf ("SBBreakpoint::GetHitCount");
-
- if (m_opaque_sp)
- {
- uint32_t hit_count = m_opaque_sp->GetHitCount();
- if (log)
- 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 (this.sp=%p) => '0'", m_opaque_sp.get());
- return 0;
- }
+ return count;
}
uint32_t
SBBreakpoint::GetIgnoreCount () const
{
+ uint32_t count = 0;
if (m_opaque_sp)
- return m_opaque_sp->GetIgnoreCount();
- else
- return 0;
+ count = m_opaque_sp->GetIgnoreCount();
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::GetIgnoreCount () => %u", m_opaque_sp.get(), count);
+
+ return count;
}
void
-SBBreakpoint::SetThreadID (tid_t sb_thread_id)
+SBBreakpoint::SetThreadID (tid_t tid)
{
if (m_opaque_sp)
- m_opaque_sp->SetThreadID (sb_thread_id);
+ m_opaque_sp->SetThreadID (tid);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4x)", m_opaque_sp.get(), tid);
+
}
tid_t
SBBreakpoint::GetThreadID ()
{
- tid_t lldb_thread_id = LLDB_INVALID_THREAD_ID;
+ tid_t tid = LLDB_INVALID_THREAD_ID;
if (m_opaque_sp)
- lldb_thread_id = m_opaque_sp->GetThreadID();
+ tid = m_opaque_sp->GetThreadID();
- return lldb_thread_id;
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::GetThreadID () => 0x%4.4x", m_opaque_sp.get(), tid);
+ return tid;
}
void
SBBreakpoint::SetThreadIndex (uint32_t index)
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::SetThreadIndex (%u)", m_opaque_sp.get(), index);
if (m_opaque_sp)
m_opaque_sp->GetOptions()->GetThreadSpec()->SetIndex (index);
}
@@ -331,14 +302,17 @@
uint32_t
SBBreakpoint::GetThreadIndex() const
{
+ uint32_t thread_idx = 0;
if (m_opaque_sp)
{
const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpec();
if (thread_spec == NULL)
- return 0;
- else
- return thread_spec->GetIndex();
+ thread_idx = thread_spec->GetIndex();
}
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::GetThreadIndex () => %u", m_opaque_sp.get(), index);
+
return 0;
}
@@ -346,6 +320,10 @@
void
SBBreakpoint::SetThreadName (const char *thread_name)
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::SetThreadName (%s)", m_opaque_sp.get(), thread_name);
+
if (m_opaque_sp)
m_opaque_sp->GetOptions()->GetThreadSpec()->SetName (thread_name);
}
@@ -353,20 +331,26 @@
const char *
SBBreakpoint::GetThreadName () const
{
+ const char *name = NULL;
if (m_opaque_sp)
{
const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpec();
if (thread_spec == NULL)
- return NULL;
- else
- return thread_spec->GetName();
+ name = thread_spec->GetName();
}
- return NULL;
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::GetThreadName () => %s", m_opaque_sp.get(), name);
+
+ return name;
}
void
SBBreakpoint::SetQueueName (const char *queue_name)
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::SetQueueName (%s)", m_opaque_sp.get(), queue_name);
if (m_opaque_sp)
m_opaque_sp->GetOptions()->GetThreadSpec()->SetQueueName (queue_name);
}
@@ -374,33 +358,41 @@
const char *
SBBreakpoint::GetQueueName () const
{
+ const char *name = NULL;
if (m_opaque_sp)
{
const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpec();
- if (thread_spec == NULL)
- return NULL;
- else
- return thread_spec->GetQueueName();
+ name = thread_spec->GetQueueName();
}
- return NULL;
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::GetQueueName () => %s", m_opaque_sp.get(), name);
+
+ return name;
}
size_t
SBBreakpoint::GetNumResolvedLocations() const
{
+ size_t num_resolved = 0;
if (m_opaque_sp)
- return m_opaque_sp->GetNumResolvedLocations();
- else
- return 0;
+ num_resolved = m_opaque_sp->GetNumResolvedLocations();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %zu", m_opaque_sp.get(), num_resolved);
+ return num_resolved;
}
size_t
SBBreakpoint::GetNumLocations() const
{
+ size_t num_locs = 0;
if (m_opaque_sp)
- return m_opaque_sp->GetNumLocations();
- else
- return 0;
+ num_locs = m_opaque_sp->GetNumLocations();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBBreakpoint(%p)::GetNumLocations () => %zu", m_opaque_sp.get(), num_locs);
+ return num_locs;
}
bool
@@ -461,18 +453,11 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBBreakpoint::SetCallback (this.sp=%p, :", m_opaque_sp.get());
+ log->Printf ("SBBreakpoint(%p)::SetCallback (callback=%p, baton=%p)", m_opaque_sp.get(), callback, baton);
if (m_opaque_sp.get())
{
BatonSP baton_sp(new SBBreakpointCallbackBaton (callback, baton));
- if (log)
- {
- // CAROLINE: FIXME!!
- //StreamString sstr;
- //baton_sp->GetDescription (sstr, lldb::eDescriptionLevelFull);
- //log->Printf ("%s", sstr.GetData());
- }
m_opaque_sp->SetCallback (SBBreakpoint::PrivateBreakpointHitCallback, baton_sp, false);
}
}
Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/trunk/source/API/SBCommandInterpreter.cpp Fri Oct 29 23:51:46 2010
@@ -36,8 +36,8 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBCommandInterpreter::SBCommandInterpreter (interpreter = %p)"
- " => this.obj = %p", interpreter, m_opaque_ptr);
+ log->Printf ("SBCommandInterpreter::SBCommandInterpreter (interpreter=%p)"
+ " => SBCommandInterpreter(%p)", interpreter, m_opaque_ptr);
}
SBCommandInterpreter::~SBCommandInterpreter ()
@@ -73,8 +73,8 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf("SBCommandInterpreter::HandleCommand (this.obj=%p, command_line='%s', result=%p, "
- "add_to_history='%s')", m_opaque_ptr, command_line, &result, (add_to_history ? "true" : "false"));
+ log->Printf ("SBCommandInterpreter(%p)::HandleCommand (command_line='%s', result=%p, add_to_history=%i)",
+ m_opaque_ptr, command_line, &result, add_to_history);
result.Clear();
if (m_opaque_ptr)
@@ -93,8 +93,8 @@
{
SBStream sstr;
result.GetDescription (sstr);
- log->Printf ("SBCommandInterpreter::HandleCommand ('%s') => SBCommandReturnObject: '%s'",
- command_line, sstr.GetData());
+ log->Printf ("SBCommandInterpreter(%p)::HandleCommand (\"%s\") => SBCommandReturnObject(%p): '%s'",
+ m_opaque_ptr, command_line, result.get(), sstr.GetData());
}
return result.GetStatus();
@@ -156,27 +156,39 @@
if (target)
process.SetProcess(target->GetProcessSP());
}
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
+ if (log)
+ log->Printf ("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)",
+ m_opaque_ptr, process.get());
+
+
return process;
}
ssize_t
SBCommandInterpreter::WriteToScriptInterpreter (const char *src)
{
- if (m_opaque_ptr && src && src[0])
- return WriteToScriptInterpreter (src, strlen(src));
- return 0;
+ return WriteToScriptInterpreter (src, strlen(src));
}
ssize_t
SBCommandInterpreter::WriteToScriptInterpreter (const char *src, size_t src_len)
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
+ ssize_t bytes_written = 0;
if (m_opaque_ptr && src && src[0])
{
ScriptInterpreter *script_interpreter = m_opaque_ptr->GetScriptInterpreter();
if (script_interpreter)
- return ::write (script_interpreter->GetMasterFileDescriptor(), src, src_len);
+ bytes_written = ::write (script_interpreter->GetMasterFileDescriptor(), src, src_len);
}
- return 0;
+ if (log)
+ log->Printf ("SBCommandInterpreter(%p)::WriteToScriptInterpreter (src=\"%s\", src_len=%zu) => %zi",
+ m_opaque_ptr, src, src_len, bytes_written);
+
+ return bytes_written;
}
@@ -212,6 +224,12 @@
result->AppendError ("SBCommandInterpreter is not valid");
result->SetStatus (eReturnStatusFailed);
}
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
+ if (log)
+ log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInHomeDirectory (&SBCommandReturnObject(%p))",
+ m_opaque_ptr, result.get());
+
}
void
@@ -227,6 +245,11 @@
result->AppendError ("SBCommandInterpreter is not valid");
result->SetStatus (eReturnStatusFailed);
}
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
+ if (log)
+ log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInCurrentWorkingDirectory (&SBCommandReturnObject(%p))",
+ m_opaque_ptr, result.get());
}
SBBroadcaster
@@ -234,13 +257,10 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBCommandInterpreter::GetBroadcaster ()");
-
SBBroadcaster broadcaster (m_opaque_ptr, false);
if (log)
- log->Printf ("SBCommandInterpreter::GetBroadcaster (this.obj=%p) => SBBroadcaster (this.m_opaque_ptr=%p)",
+ log->Printf ("SBCommandInterpreter(%p)::GetBroadcaster() => SBBroadcaster(%p)",
m_opaque_ptr, broadcaster.get());
return broadcaster;
Modified: lldb/trunk/source/API/SBCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommunication.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommunication.cpp (original)
+++ lldb/trunk/source/API/SBCommunication.cpp Fri Oct 29 23:51:46 2010
@@ -32,7 +32,7 @@
if (log)
log->Printf ("SBCommunication::SBCommunication (broadcaster_name='%s') => "
- "this.obj = %p", broadcaster_name, m_opaque);
+ "SBCommunication(%p): owned = 1", broadcaster_name, m_opaque);
}
SBCommunication::~SBCommunication()
@@ -84,10 +84,7 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBCommunication::AdoptFileDescriptor (this=%p, fd='%d', owns_fd='%s')", this, fd,
- // (owns_fd ? "true" : "false"));
-
+ ConnectionStatus status = eConnectionStatusNoConnection;
if (m_opaque)
{
if (m_opaque->HasConnection ())
@@ -97,26 +94,16 @@
}
m_opaque->SetConnection (new ConnectionFileDescriptor (fd, owns_fd));
if (m_opaque->IsConnected())
- {
- if (log)
- log->Printf ("SBCommunication::AdoptFileDescriptor (this.obj=%p, fd=%d, ownd_fd='%s') "
- "=> eConnectionStatusSuccess", m_opaque, fd, (owns_fd ? "true" : "false"));
- return eConnectionStatusSuccess;
- }
+ status = eConnectionStatusSuccess;
else
- {
- if (log)
- log->Printf ("SBCommunication::AdoptFileDescriptor (this.obj=%p, fd=%d, ownd_fd='%s') "
- "=> eConnectionStatusLostConnection", m_opaque, fd, (owns_fd ? "true" : "false"));
- return eConnectionStatusLostConnection;
- }
+ status = eConnectionStatusLostConnection;
}
if (log)
- log->Printf ("SBCommunication::AdoptFileDescriptor (this,obj=%p, fd=%d, ownd_fd='%s') "
- "=> eConnectionStatusNoConnection", m_opaque, fd, (owns_fd ? "true" : "false"));
+ log->Printf ("SBCommunication(%p)::AdoptFileDescriptor (fd=%d, ownd_fd=%i) => %s",
+ m_opaque, fd, owns_fd, Communication::ConnectionStatusAsCString (status));
- return eConnectionStatusNoConnection;
+ return status;
}
@@ -125,15 +112,12 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBCommunication::Disconnect ()");
-
ConnectionStatus status= eConnectionStatusNoConnection;
if (m_opaque)
status = m_opaque->Disconnect ();
if (log)
- log->Printf ("SBCommunication::Disconnect (this.obj=%p) => '%s'", m_opaque,
+ log->Printf ("SBCommunication(%p)::Disconnect () => %s", m_opaque,
Communication::ConnectionStatusAsCString (status));
return status;
@@ -142,27 +126,52 @@
bool
SBCommunication::IsConnected () const
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ bool result = false;
if (m_opaque)
- return m_opaque->IsConnected ();
+ result = m_opaque->IsConnected ();
+
+ if (log)
+ log->Printf ("SBCommunication(%p)::IsConnected () => %i", m_opaque, result);
+
return false;
}
size_t
SBCommunication::Read (void *dst, size_t dst_len, uint32_t timeout_usec, ConnectionStatus &status)
{
- if (m_opaque)
- return m_opaque->Read (dst, dst_len, timeout_usec, status, NULL);
- status = eConnectionStatusNoConnection;
- return 0;
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%zu, timeout_usec=%u, &status)...",
+ m_opaque, dst, dst_len, timeout_usec);
+ size_t bytes_read = 0;
+ if (m_opaque)
+ bytes_read = m_opaque->Read (dst, dst_len, timeout_usec, status, NULL);
+ else
+ status = eConnectionStatusNoConnection;
+
+ if (log)
+ log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%zu, timeout_usec=%u, &status=%s) => %zu",
+ m_opaque, dst, dst_len, timeout_usec, Communication::ConnectionStatusAsCString (status),
+ bytes_read);
+ return bytes_read;
}
size_t
SBCommunication::Write (const void *src, size_t src_len, ConnectionStatus &status)
{
+ size_t bytes_written = 0;
if (m_opaque)
- return m_opaque->Write (src, src_len, status, NULL);
- status = eConnectionStatusNoConnection;
+ bytes_written = m_opaque->Write (src, src_len, status, NULL);
+ else
+ status = eConnectionStatusNoConnection;
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBCommunication(%p)::Write (src=%p, src_len=%zu, &status=%s) => %zu",
+ m_opaque, src, src_len, Communication::ConnectionStatusAsCString (status), bytes_written);
+
return 0;
}
@@ -171,16 +180,13 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBCommunication::ReadThreadStart ()");
-
bool success = false;
if (m_opaque)
success = m_opaque->StartReadThread ();
log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBCommunication::ReadThreadStart (this.obj=%p) => '%s'", m_opaque, (success ? "true" : "false"));
+ log->Printf ("SBCommunication(%p)::ReadThreadStart () => %i", m_opaque, success);
return success;
}
@@ -189,17 +195,16 @@
bool
SBCommunication::ReadThreadStop ()
{
-
- //if (log)
- // log->Printf ("SBCommunication::ReadThreadStop ()");
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBCommunication(%p)::ReadThreadStop ()...", m_opaque);
bool success = false;
if (m_opaque)
success = m_opaque->StopReadThread ();
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBCommunication::ReadThreadStop (this.obj=%p) => '%s'", m_opaque, (success ? "true" : "false"));
+ log->Printf ("SBCommunication(%p)::ReadThreadStop () => %i", m_opaque, success);
return success;
}
@@ -207,9 +212,13 @@
bool
SBCommunication::ReadThreadIsRunning ()
{
+ bool result = false;
if (m_opaque)
- return m_opaque->ReadThreadIsRunning ();
- return false;
+ result = m_opaque->ReadThreadIsRunning ();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBCommunication(%p)::ReadThreadIsRunning () => %i", m_opaque, result);
+ return result;
}
bool
@@ -221,28 +230,31 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- if (log)
- log->Printf ("SBCommunication::SetReadThreadBytesReceivedCallback (this.obj=%p, callback=%p, baton=%p)",
- m_opaque, callback, callback_baton);
-
+ bool result = false;
if (m_opaque)
{
m_opaque->SetReadThreadBytesReceivedCallback (callback, callback_baton);
- if (log)
- log->Printf ("SBCommunication::SetReaDThreadBytesReceivedCallback (this.obj=%p...) => true", m_opaque);
- return true;
+ result = true;
}
if (log)
- log->Printf ("SBCommunication::SetReaDThreadBytesReceivedCallback (this.obj=%p...) => false", m_opaque);
+ log->Printf ("SBCommunication(%p)::SetReadThreadBytesReceivedCallback (callback=%p, baton=%p) => %i",
+ m_opaque, callback, callback_baton, result);
- return false;
+ return result;
}
SBBroadcaster
SBCommunication::GetBroadcaster ()
{
SBBroadcaster broadcaster (m_opaque, false);
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
+ if (log)
+ log->Printf ("SBCommunication(%p)::GetBroadcaster () => SBBroadcaster (%p)",
+ m_opaque, broadcaster.get());
+
return broadcaster;
}
Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Fri Oct 29 23:51:46 2010
@@ -411,19 +411,20 @@
const char *
SBDebugger::StateAsCString (lldb::StateType state)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- log->Printf ("SBDebugger::StateAsCString (state=%d) => '%s'", state,
- lldb_private::StateAsCString (state));
-
return lldb_private::StateAsCString (state);
}
bool
SBDebugger::StateIsRunningState (lldb::StateType state)
{
- return lldb_private::StateIsRunningState (state);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
+ const bool result = lldb_private::StateIsRunningState (state);
+ if (log)
+ log->Printf ("SBDebugger::StateIsRunningState (state=%s) => %i",
+ lldb_private::StateAsCString (state), result);
+
+ return result;
}
bool
@@ -431,11 +432,12 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ const bool result = lldb_private::StateIsStoppedState (state);
if (log)
- log->Printf ("SBDebugger::StateIsStoppedState (state=%d) => '%s'", state,
- (lldb_private::StateIsStoppedState (state) ? "true" : "false"));
+ log->Printf ("SBDebugger::StateIsStoppedState (state=%s) => %i",
+ lldb_private::StateAsCString (state), result);
- return lldb_private::StateIsStoppedState (state);
+ return result;
}
@@ -453,6 +455,14 @@
Error error (m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, file_spec, arch, NULL, true, target_sp));
target.reset (target_sp);
}
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ {
+ log->Printf ("SBDebugger(%p)::CreateTargetWithFileAndTargetTriple (filename='%s', tiple = %s) => SBTarget(%p)",
+ m_opaque_sp.get(), filename, target_triple, target.get());
+ }
+
return target;
}
@@ -501,11 +511,8 @@
if (log)
{
- SBStream sstr;
- target.GetDescription (sstr, lldb::eDescriptionLevelFull);
- log->Printf ("SBDebugger(%p)::CreateTargetWithFileAndArch (filename='%s', arcname='%s') "
- "=> SBTarget(%p): %s", m_opaque_sp.get(), filename, archname, target.get(),
- sstr.GetData());
+ log->Printf ("SBDebugger(%p)::CreateTargetWithFileAndArch (filename='%s', arch = %s) => SBTarget(%p)",
+ m_opaque_sp.get(), filename, archname, target.get());
}
return target;
@@ -543,6 +550,12 @@
target.reset (target_sp);
}
}
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ {
+ log->Printf ("SBDebugger(%p)::CreateTarget (filename='%s') => SBTarget(%p)",
+ m_opaque_sp.get(), filename, target.get());
+ }
return target;
}
Modified: lldb/trunk/source/API/SBError.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBError.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBError.cpp (original)
+++ lldb/trunk/source/API/SBError.cpp Fri Oct 29 23:51:46 2010
@@ -35,8 +35,8 @@
{
SBStream sstr;
GetDescription (sstr);
- 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());
+ log->Printf ("SBError::SBError (const SBError rhs.ap=%p) => SBError(%p): %s",
+ rhs.m_opaque_ap.get(), m_opaque_ap.get(), sstr.GetData());
}
}
@@ -49,7 +49,7 @@
SBError::operator = (const SBError &rhs)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
+ void *old_error = m_opaque_ap.get();
if (rhs.IsValid())
{
if (m_opaque_ap.get())
@@ -66,8 +66,8 @@
{
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());
+ log->Printf ("SBError(%p)::operator= (SBError(%p)) => SBError(%s)",
+ old_error, rhs.m_opaque_ap.get(), sstr.GetData());
}
return *this;
@@ -94,15 +94,12 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //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 (this.ap=%p) => '%s'", m_opaque_ap.get(), (ret_value ? "true" : "false"));
+ log->Printf ("SBError(%p)::Fail () => %i", m_opaque_ap.get(), ret_value);
return ret_value;
}
@@ -110,25 +107,45 @@
bool
SBError::Success () const
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ bool ret_value = false;
if (m_opaque_ap.get())
- return m_opaque_ap->Success();
- return false;
+ ret_value = m_opaque_ap->Success();
+
+ if (log)
+ log->Printf ("SBError(%p)::Success () => %i", m_opaque_ap.get(), ret_value);
+
+ return ret_value;
}
uint32_t
SBError::GetError () const
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
+ uint32_t err = 0;
if (m_opaque_ap.get())
- return m_opaque_ap->GetError();
- return true;
+ err = m_opaque_ap->GetError();
+
+ if (log)
+ log->Printf ("SBError(%p)::GetError () => 0x%8.8x", m_opaque_ap.get(), err);
+
+
+ return err;
}
ErrorType
SBError::GetType () const
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ ErrorType err_type = eErrorTypeInvalid;
if (m_opaque_ap.get())
- return m_opaque_ap->GetType();
- return eErrorTypeInvalid;
+ err_type = m_opaque_ap->GetType();
+
+ if (log)
+ log->Printf ("SBError(%p)::GetType () => %i", m_opaque_ap.get(), err_type);
+
+ return err_type;
}
void
Modified: lldb/trunk/source/API/SBEvent.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBEvent.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBEvent.cpp (original)
+++ lldb/trunk/source/API/SBEvent.cpp Fri Oct 29 23:51:46 2010
@@ -117,10 +117,10 @@
success = lldb_event->BroadcasterIs (broadcaster.get());
if (log)
- log->Printf ("SBEvent(%p)::BroadcasterMathesRef (broadcaster.ptr=%p) => %s",
+ log->Printf ("SBEvent(%p)::BroadcasterMatchesRef (SBBroadcaster(%p)) => %i",
get(),
broadcaster.get(),
- success ? "true" : "false");
+ success);
return success;
}
Modified: lldb/trunk/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpec.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpec.cpp (original)
+++ lldb/trunk/source/API/SBFileSpec.cpp Fri Oct 29 23:51:46 2010
@@ -108,29 +108,27 @@
const char *
SBFileSpec::GetFilename() const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
+ const char *s = NULL;
if (m_opaque_ap.get())
- {
- if (log)
- log->Printf ("SBFileSpec(%p)::GetFilename () => %s", m_opaque_ap.get(),
- m_opaque_ap->GetFilename().AsCString());
-
- return m_opaque_ap->GetFilename().AsCString();
- }
+ s = m_opaque_ap->GetFilename().AsCString();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBFileSpec(%p)::GetFilename () => NULL", m_opaque_ap.get());
+ log->Printf ("SBFileSpec(%p)::GetFilename () => \"%s\"", m_opaque_ap.get(), s ? s : "");
- return NULL;
+ return s;
}
const char *
SBFileSpec::GetDirectory() const
{
+ const char *s = NULL;
if (m_opaque_ap.get())
- return m_opaque_ap->GetDirectory().AsCString();
- return NULL;
+ s = m_opaque_ap->GetDirectory().AsCString();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFileSpec(%p)::GetDirectory () => \"%s\"", m_opaque_ap.get(), s ? s : "");
+ return s;
}
uint32_t
Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Fri Oct 29 23:51:46 2010
@@ -57,8 +57,8 @@
{
SBStream sstr;
GetDescription (sstr);
- log->Printf ("SBFrame::SBFrame (lldb_object_sp=%p) => this.sp = %p (%s)", lldb_object_sp.get(),
- m_opaque_sp.get(), sstr.GetData());
+ log->Printf ("SBFrame::SBFrame (sp=%p) => SBFrame(%p): %s",
+ lldb_object_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
}
@@ -71,7 +71,16 @@
void
SBFrame::SetFrame (const lldb::StackFrameSP &lldb_object_sp)
{
+ void *old_ptr = m_opaque_sp.get();
m_opaque_sp = lldb_object_sp;
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
+ if (log)
+ {
+ log->Printf ("SBFrame(%p)::SetFrame(sp=%p) := SBFrame(%p)",
+ old_ptr, lldb_object_sp.get(), m_opaque_sp.get());
+ }
+
}
@@ -84,17 +93,14 @@
SBSymbolContext
SBFrame::GetSymbolContext (uint32_t resolve_scope) const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //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));
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBFrame::GetSymbolContext (this.sp=%p, resolve_scope=%d) => SBSymbolContext (this.ap = %p)",
+ log->Printf ("SBFrame(%p)::GetSymbolContext (resolve_scope=0x%8.8x) => SBSymbolContext(%p)",
m_opaque_sp.get(), resolve_scope, sb_sym_ctx.get());
return sb_sym_ctx;
@@ -104,22 +110,23 @@
SBFrame::GetModule () const
{
SBModule sb_module (m_opaque_sp->GetSymbolContext (eSymbolContextModule).module_sp);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetModule () => SBModule(%p)",
+ m_opaque_sp.get(), sb_module.get());
+
return sb_module;
}
SBCompileUnit
SBFrame::GetCompileUnit () const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //if (log)
- // log->Printf ("SBFrame::GetCompileUnit()");
-
SBCompileUnit sb_comp_unit(m_opaque_sp->GetSymbolContext (eSymbolContextCompUnit).comp_unit);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBFrame::GetCompileUnit (this.sp=%p) => SBCompileUnit (this=%p)", m_opaque_sp.get(),
- sb_comp_unit.get());
+ log->Printf ("SBFrame(%p)::GetModule () => SBCompileUnit(%p)",
+ m_opaque_sp.get(), sb_comp_unit.get());
return sb_comp_unit;
}
@@ -128,6 +135,12 @@
SBFrame::GetFunction () const
{
SBFunction sb_function(m_opaque_sp->GetSymbolContext (eSymbolContextFunction).function);
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetFunction () => SBFunction(%p)",
+ m_opaque_sp.get(), sb_function.get());
+
return sb_function;
}
@@ -135,6 +148,10 @@
SBFrame::GetSymbol () const
{
SBSymbol sb_symbol(m_opaque_sp->GetSymbolContext (eSymbolContextSymbol).symbol);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetSymbol () => SBSymbol(%p)",
+ m_opaque_sp.get(), sb_symbol.get());
return sb_symbol;
}
@@ -142,6 +159,10 @@
SBFrame::GetBlock () const
{
SBBlock sb_block(m_opaque_sp->GetSymbolContext (eSymbolContextBlock).block);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetBlock () => SBBlock(%p)",
+ m_opaque_sp.get(), sb_block.get());
return sb_block;
}
@@ -149,6 +170,10 @@
SBFrame::GetFrameBlock () const
{
SBBlock sb_block(m_opaque_sp->GetFrameBlock ());
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetFrameBlock () => SBBlock(%p)",
+ m_opaque_sp.get(), sb_block.get());
return sb_block;
}
@@ -156,32 +181,36 @@
SBFrame::GetLineEntry () const
{
SBLineEntry sb_line_entry(&m_opaque_sp->GetSymbolContext (eSymbolContextLineEntry).line_entry);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetLineEntry () => SBLineEntry(%p)",
+ m_opaque_sp.get(), sb_line_entry.get());
return sb_line_entry;
}
uint32_t
SBFrame::GetFrameID () const
{
- if (m_opaque_sp)
- return m_opaque_sp->GetFrameIndex ();
- else
- return UINT32_MAX;
+ uint32_t frame_idx = m_opaque_sp ? m_opaque_sp->GetFrameIndex () : UINT32_MAX;
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetFrameID () => %u",
+ m_opaque_sp.get(), frame_idx);
+ return frame_idx;
}
lldb::addr_t
SBFrame::GetPC () const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //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());
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBFrame::GetPC (this.sp=%p) => %p", m_opaque_sp.get(), addr);
+ log->Printf ("SBFrame(%p)::GetPC () => %0xllx", m_opaque_sp.get(), addr);
return addr;
}
@@ -189,18 +218,15 @@
bool
SBFrame::SetPC (lldb::addr_t new_pc)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //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);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBFrame::SetPC (this.sp=%p, new_pc=%p) => '%s'", m_opaque_sp.get(), new_pc,
- (ret_val ? "true" : "false"));
+ log->Printf ("SBFrame(%p)::SetPC (new_pc=0x%llx) => %i",
+ m_opaque_sp.get(), new_pc, ret_val);
return ret_val;
}
@@ -208,27 +234,27 @@
lldb::addr_t
SBFrame::GetSP () const
{
+ addr_t addr = LLDB_INVALID_ADDRESS;
if (m_opaque_sp)
- return m_opaque_sp->GetRegisterContext()->GetSP();
- return LLDB_INVALID_ADDRESS;
+ addr = m_opaque_sp->GetRegisterContext()->GetSP();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetSP () => %0xllx", m_opaque_sp.get(), addr);
+
+ return addr;
}
lldb::addr_t
SBFrame::GetFP () const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //if (log)
- // log->Printf ("SBFrame::GetFP ()");
-
lldb::addr_t addr = LLDB_INVALID_ADDRESS;
if (m_opaque_sp)
addr = m_opaque_sp->GetRegisterContext()->GetFP();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBFrame::GetFP (this.sp=%p) => %p", m_opaque_sp.get(), addr);
-
+ log->Printf ("SBFrame(%p)::GetFP () => %0xllx", m_opaque_sp.get(), addr);
return addr;
}
@@ -239,6 +265,9 @@
SBAddress sb_addr;
if (m_opaque_sp)
sb_addr.SetAddress (&m_opaque_sp->GetFrameCodeAddress());
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::GetPCAddress () => SBAddress(%p)", m_opaque_sp.get(), sb_addr.get());
return sb_addr;
}
@@ -274,13 +303,17 @@
if (!found)
var_sp.reset();
}
- if (var_sp)
- {
- SBValue sb_value (ValueObjectSP (new ValueObjectVariable (var_sp)));
- return sb_value;
- }
SBValue sb_value;
+
+ if (var_sp)
+ *sb_value = ValueObjectSP (new ValueObjectVariable (var_sp));
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::LookupVar (name=\"%s\") => SBValue(%p)",
+ m_opaque_sp.get(), var_name, sb_value.get());
+
return sb_value;
}
@@ -327,13 +360,16 @@
}
}
+ SBValue sb_value;
if (var_sp)
- {
- SBValue sb_value (ValueObjectSP (new ValueObjectVariable (var_sp)));
- return sb_value;
- }
+ *sb_value = ValueObjectSP (new ValueObjectVariable (var_sp));
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBFrame(%p)::LookupVarInScope (name=\"%s\", scope=%s) => SBValue(%p)",
+ m_opaque_sp.get(), var_name, scope, sb_value.get());
+
- SBValue sb_value;
return sb_value;
}
@@ -376,8 +412,8 @@
{
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());
+ log->Printf ("SBFrame(%p)::GetThread () => SBThread(%p): %s", m_opaque_sp.get(),
+ sb_thread.get(), sstr.GetData());
}
return sb_thread;
@@ -386,27 +422,18 @@
const char *
SBFrame::Disassemble () const
{
+ const char *disassembly = NULL;
+ if (m_opaque_sp)
+ disassembly = m_opaque_sp->Disassemble();
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- Log *verbose_log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
- if (verbose_log)
- verbose_log->Printf ("SBFrame::Disassemble (this.sp=%p) => %s", m_opaque_sp.get(), m_opaque_sp->Disassemble());
- else if (log)
- log->Printf ("SBFrame::Disassemble (this.sp=%p)", m_opaque_sp.get());
+ if (log)
+ log->Printf ("SBFrame(%p)::Disassemble () => %s", m_opaque_sp.get(), disassembly);
- if (m_opaque_sp)
- return m_opaque_sp->Disassemble();
- return NULL;
+ return disassembly;
}
-
-lldb_private::StackFrame *
-SBFrame::GetLLDBObjectPtr ()
-{
- return m_opaque_sp.get();
-}
-
SBValueList
SBFrame::GetVariables (bool arguments,
bool locals,
@@ -416,12 +443,12 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBFrame::GetVariables (this_sp.get=%p, arguments=%s, locals=%s, statics=%s, in_scope_only=%s)",
+ log->Printf ("SBFrame(%p)::GetVariables (arguments=%i, locals=%i, statics=%i, in_scope_only=%i)",
m_opaque_sp.get(),
- (arguments ? "true" : "false"),
- (locals ? "true" : "false"),
- (statics ? "true" : "false"),
- (in_scope_only ? "true" : "false"));
+ arguments,
+ locals,
+ statics,
+ in_scope_only);
SBValueList value_list;
if (m_opaque_sp)
@@ -472,14 +499,8 @@
if (log)
{
- log->Printf ("SBFrame::GetVariables (this.sp=%p,...) => SBValueList (this.ap = %p)", m_opaque_sp.get(),
+ log->Printf ("SBFrame(%p)::GetVariables (...) => SBValueList(%p)", m_opaque_sp.get(),
value_list.get());
- //uint32_t num_vars = value_list.GetSize();
- //for (uint32_t i = 0; i < num_vars; ++i)
- //{
- // SBValue value = value_list.GetValueAtIndex (i);
- // log->Printf (" %s : %s", value.GetName(), value.GetObjectDescription (*this));
- //}
}
return value_list;
@@ -490,9 +511,6 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBFrame::GetRegisters ()");
-
SBValueList value_list;
if (m_opaque_sp)
{
@@ -508,16 +526,7 @@
}
if (log)
- {
- 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)
- //{
- // SBValue value = value_list.GetValueAtIndex (i);
- // log->Printf (" %s : %s", value.GetName(), value.GetObjectDescription (*this));
- //}
- }
+ log->Printf ("SBFrame(%p)::Registers () => SBValueList(%p)", m_opaque_sp.get(), value_list.get());
return value_list;
}
@@ -542,7 +551,12 @@
lldb::SBValue
SBFrame::EvaluateExpression (const char *expr)
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+
lldb::SBValue expr_result_value;
+ if (log)
+ log->Printf ("SBFrame(%p)::EvaluateExpression (expr=\"%s\")...", m_opaque_sp.get(), expr);
+
if (m_opaque_sp)
{
ExecutionContext exe_ctx;
@@ -555,5 +569,9 @@
*expr_result_value = ClangUserExpression::Evaluate (exe_ctx, expr, prefix);
}
+
+ if (log)
+ log->Printf ("SBFrame(%p)::EvaluateExpression (expr=\"%s\") => SBValue(%p)", m_opaque_sp.get(), expr_result_value.get());
+
return expr_result_value;
}
Modified: lldb/trunk/source/API/SBInputReader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInputReader.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBInputReader.cpp (original)
+++ lldb/trunk/source/API/SBInputReader.cpp Fri Oct 29 23:51:46 2010
@@ -36,7 +36,7 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBInputReader::SBInputReader (reader_sp=%p) => this.sp = %p", reader_sp.get(),
+ log->Printf ("SBInputReader::SBInputReader (reader_sp=%p) => SBInputReader(%p)", reader_sp.get(),
m_opaque_sp.get());
}
@@ -46,7 +46,7 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf("SBInputReader::SBInputReader (rhs.sp=%p) => this.sp = %p",
+ log->Printf("SBInputReader::SBInputReader (rhs.sp=%p) => SBInputReader(%p)",
rhs.m_opaque_sp.get(), m_opaque_sp.get());
}
@@ -87,10 +87,14 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- 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"));
+ log->Printf("SBInputReader(%p)::Initialize (SBDebugger(%p), callback_function=%p, callback_baton=%p, "
+ "granularity='%s', end_token='%s', prompt='%s', echo=%i)",
+ m_opaque_sp.get(),
+ debugger.get(),
+ callback_function,
+ callback_baton,
+ InputReader::GranularityAsCString (granularity), end_token, prompt,
+ echo);
SBError sb_error;
m_opaque_sp.reset (new InputReader (debugger.ref()));
@@ -119,7 +123,7 @@
{
SBStream sstr;
sb_error.GetDescription (sstr);
- log->Printf ("SBInputReader::Initialize (this.sp=%p, ...) => SBError (this.ap=%p, '%s')", m_opaque_sp.get(),
+ log->Printf ("SBInputReader(%p)::Initialize (...) => SBError(%p): %s", m_opaque_sp.get(),
sb_error.get(), sstr.GetData());
}
@@ -192,16 +196,12 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //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 (this.sp=%p) => '%s'", m_opaque_sp.get(),
- (ret_value ? "true" : "false"));
+ log->Printf ("SBInputReader(%p)::IsActive () => %i", m_opaque_sp.get(), ret_value);
return ret_value;
}
Modified: lldb/trunk/source/API/SBListener.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBListener.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBListener.cpp (original)
+++ lldb/trunk/source/API/SBListener.cpp Fri Oct 29 23:51:46 2010
@@ -87,18 +87,18 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- uint32_t ret_value = 0;
+ uint32_t aquired_event_mask = 0;
if (m_opaque_ptr && broadcaster.IsValid())
{
- ret_value = m_opaque_ptr->StartListeningForEvents (broadcaster.get(), event_mask);
+ aquired_event_mask = m_opaque_ptr->StartListeningForEvents (broadcaster.get(), event_mask);
}
log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBListener(%p)::StartListeneingForEvents (SBBroadcaster(%p), event_mask=0x%8.8x) => %d",
- m_opaque_ptr, broadcaster.get(), event_mask, ret_value);
+ log->Printf ("SBListener(%p)::StartListeneingForEvents (SBBroadcaster(%p), event_mask=0x%8.8x) => 0x%8.8x",
+ m_opaque_ptr, broadcaster.get(), event_mask, aquired_event_mask);
- return ret_value;
+ return aquired_event_mask;
}
bool
Modified: lldb/trunk/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBModule.cpp (original)
+++ lldb/trunk/source/API/SBModule.cpp Fri Oct 29 23:51:46 2010
@@ -28,10 +28,6 @@
SBModule::SBModule (const lldb::ModuleSP& module_sp) :
m_opaque_sp (module_sp)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- log->Printf ("SBModule::SBModule (module_sp=%p) => this.sp = %p", module_sp.get(), m_opaque_sp.get());
}
SBModule::~SBModule ()
@@ -49,9 +45,6 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBModule::GetFileSpec ()");
-
SBFileSpec file_spec;
if (m_opaque_sp)
file_spec.SetFileSpec(m_opaque_sp->GetFileSpec());
@@ -60,7 +53,7 @@
{
SBStream sstr;
file_spec.GetDescription (sstr);
- log->Printf ("SBModule::GetFileSpec (this.sp=%p) => SBFileSpec : this.ap = %p, 's'", m_opaque_sp.get(),
+ log->Printf ("SBModule(%p)::GetFileSpec () => SBFileSpec(%p): %s", m_opaque_sp.get(),
file_spec.get(), sstr.GetData());
}
@@ -72,23 +65,22 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBModule::GetUUIDBytes ()");
-
+ const uint8_t *uuid_bytes = NULL;
if (m_opaque_sp)
+ uuid_bytes = (const uint8_t *)m_opaque_sp->GetUUID().GetBytes();
+
+ if (log)
{
- if (log)
+ if (uuid_bytes)
{
- StreamString sstr;
- m_opaque_sp->GetUUID().Dump (&sstr);
- log->Printf ("SBModule::GetUUIDBytes (this.sp=%p) => '%s'", m_opaque_sp.get(), sstr.GetData());
+ StreamString s;
+ m_opaque_sp->GetUUID().Dump (&s);
+ log->Printf ("SBModule(%p)::GetUUIDBytes () => %s", m_opaque_sp.get(), s.GetData());
}
- return (const uint8_t *)m_opaque_sp->GetUUID().GetBytes();
+ else
+ log->Printf ("SBModule(%p)::GetUUIDBytes () => NULL", m_opaque_sp.get());
}
-
- if (log)
- log->Printf ("SBModule::GetUUIDBytes (this.sp=%p) => NULL", m_opaque_sp.get());
- return NULL;
+ return uuid_bytes;
}
Modified: lldb/trunk/source/API/SBProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBProcess.cpp (original)
+++ lldb/trunk/source/API/SBProcess.cpp Fri Oct 29 23:51:46 2010
@@ -53,20 +53,12 @@
SBProcess::SBProcess (const SBProcess& rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- log->Printf ("SBProcess::SBProcess(%p)", rhs.m_opaque_sp.get());
}
SBProcess::SBProcess (const lldb::ProcessSP &process_sp) :
m_opaque_sp (process_sp)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- log->Printf ("SBProcess::SBProcess(%p)", process_sp.get());
}
//----------------------------------------------------------------------
@@ -125,7 +117,7 @@
if (log)
{
- log->Printf ("SBProcess(%p)::GetSelectedThread () => SBThread(%p)", m_opaque_sp.get(), sb_thread.GetLLDBObjectPtr());
+ log->Printf ("SBProcess(%p)::GetSelectedThread () => SBThread(%p)", m_opaque_sp.get(), sb_thread.get());
}
return sb_thread;
@@ -289,7 +281,7 @@
if (log)
{
log->Printf ("SBProcess(%p)::GetThreadAtIndex (index=%d) => SBThread(%p)",
- m_opaque_sp.get(), (uint32_t) index, thread.GetLLDBObjectPtr());
+ m_opaque_sp.get(), (uint32_t) index, thread.get());
}
return thread;
@@ -298,12 +290,12 @@
StateType
SBProcess::GetState ()
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
StateType ret_val = eStateInvalid;
if (m_opaque_sp != NULL)
ret_val = m_opaque_sp->GetState();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess(%p)::GetState () => '%s'",
m_opaque_sp.get(),
@@ -316,30 +308,38 @@
int
SBProcess::GetExitStatus ()
{
- if (m_opaque_sp != NULL)
- return m_opaque_sp->GetExitStatus ();
- else
- return 0;
+ int exit_status = 0;
+ if (m_opaque_sp)
+ exit_status = m_opaque_sp->GetExitStatus ();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBProcess(%p)::GetExitStatus () => %i (0x%8.8x)",
+ m_opaque_sp.get(), exit_status, exit_status);
+
+ return exit_status;
}
const char *
SBProcess::GetExitDescription ()
{
+ const char *exit_desc = NULL;
if (m_opaque_sp != NULL)
- return m_opaque_sp->GetExitDescription ();
- else
- return NULL;
+ exit_desc = m_opaque_sp->GetExitDescription ();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBProcess(%p)::GetExitDescription () => %s",
+ m_opaque_sp.get(), exit_desc);
+ return exit_desc;
}
lldb::pid_t
SBProcess::GetProcessID ()
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
lldb::pid_t ret_val = LLDB_INVALID_PROCESS_ID;
if (m_opaque_sp)
ret_val = m_opaque_sp->GetID();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess(%p)::GetProcessID () => %d", m_opaque_sp.get(), ret_val);
@@ -349,42 +349,23 @@
uint32_t
SBProcess::GetAddressByteSize () const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
uint32_t size = 0;
if (m_opaque_sp)
size = m_opaque_sp->GetAddressByteSize();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
log->Printf ("SBProcess(%p)::GetAddressByteSize () => %d", m_opaque_sp.get(), size);
return size;
}
-bool
-SBProcess::WaitUntilProcessHasStopped (SBCommandReturnObject &result)
-{
- bool state_changed = false;
-
- if (IsValid())
- {
- EventSP event_sp;
- StateType state = m_opaque_sp->WaitForStateChangedEvents (NULL, event_sp);
-
- while (StateIsStoppedState (state))
- {
- state = m_opaque_sp->WaitForStateChangedEvents (NULL, event_sp);
- SBEvent event (event_sp);
- AppendEventStateReport (event, result);
- state_changed = true;
- }
- }
- return state_changed;
-}
-
SBError
SBProcess::Continue ()
{
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBProcess(%p)::Continue ()...", m_opaque_sp.get());
SBError sb_error;
if (IsValid())
@@ -393,14 +374,17 @@
if (error.Success())
{
if (m_opaque_sp->GetTarget().GetDebugger().GetAsyncExecution () == false)
+ {
+ if (log)
+ log->Printf ("SBProcess(%p)::Continue () waiting for process to stop...", m_opaque_sp.get());
m_opaque_sp->WaitForProcessToStop (NULL);
+ }
}
sb_error.SetError(error);
}
else
sb_error.SetErrorString ("SBProcess is invalid");
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
{
SBStream sstr;
@@ -421,6 +405,14 @@
else
sb_error.SetErrorString ("SBProcess is invalid");
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ {
+ SBStream sstr;
+ sb_error.GetDescription (sstr);
+ log->Printf ("SBProcess(%p)::Destroy () => SBError (%p): %s", m_opaque_sp.get(), sb_error.get(), sstr.GetData());
+ }
+
return sb_error;
}
@@ -475,7 +467,7 @@
SBError
-SBProcess::AttachByName (const char *name, bool wait_for_launch)
+SBProcess::AttachByName (const char *name, bool wait_for_launch) // DEPRECATED
{
SBError sb_error;
if (m_opaque_sp)
@@ -486,7 +478,7 @@
}
lldb::pid_t
-SBProcess::AttachByPID (lldb::pid_t attach_pid) // DEPRECATED: will be removed in a few builds in favor of SBError AttachByPID(pid_t)
+SBProcess::AttachByPID (lldb::pid_t attach_pid) // DEPRECATED
{
Attach (attach_pid);
return GetProcessID();
@@ -494,7 +486,7 @@
SBError
-SBProcess::Attach (lldb::pid_t attach_pid)
+SBProcess::Attach (lldb::pid_t attach_pid) // DEPRECATED
{
SBError sb_error;
if (m_opaque_sp)
@@ -517,23 +509,44 @@
}
SBError
-SBProcess::Signal (int signal)
+SBProcess::Signal (int signo)
{
SBError sb_error;
if (m_opaque_sp)
- sb_error.SetError (m_opaque_sp->Signal (signal));
+ sb_error.SetError (m_opaque_sp->Signal (signo));
else
sb_error.SetErrorString ("SBProcess is invalid");
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ {
+ SBStream sstr;
+ sb_error.GetDescription (sstr);
+ log->Printf ("SBProcess(%p)::Signal (signo=%i) => SBError (%p): %s",
+ m_opaque_sp.get(),
+ signo,
+ sb_error.get(),
+ sstr.GetData());
+ }
return sb_error;
}
SBThread
-SBProcess::GetThreadByID (tid_t sb_thread_id)
+SBProcess::GetThreadByID (tid_t tid)
{
- SBThread thread;
+ SBThread sb_thread;
if (m_opaque_sp)
- thread.SetThread (m_opaque_sp->GetThreadList().FindThreadByID ((tid_t) sb_thread_id));
- return thread;
+ sb_thread.SetThread (m_opaque_sp->GetThreadList().FindThreadByID ((tid_t) tid));
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ {
+ log->Printf ("SBProcess(%p)::GetThreadByID (tid=0x%4.4x) => SBThread (%p)",
+ m_opaque_sp.get(),
+ tid,
+ sb_thread.get());
+ }
+
+ return sb_thread;
}
StateType
@@ -591,6 +604,16 @@
size_t bytes_read = 0;
+ if (log)
+ {
+ log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%llx, dst=%p, dst_len=%zu, SBError (%p))...",
+ m_opaque_sp.get(),
+ addr,
+ dst,
+ (uint32_t) dst_len,
+ sb_error.get());
+ }
+
if (IsValid())
{
Error error;
@@ -606,7 +629,7 @@
{
SBStream sstr;
sb_error.GetDescription (sstr);
- log->Printf ("SBProcess(%p)::ReadMemory (addr=%llx, dst=%p, dst_len=%d, SBError (%p): %s) => %d",
+ log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%llx, dst=%p, dst_len=%zu, SBError (%p): %s) => %d",
m_opaque_sp.get(),
addr,
dst,
@@ -624,6 +647,17 @@
{
size_t bytes_written = 0;
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ {
+ log->Printf ("SBProcess(%p)::WriteMemory (addr=0x%llx, src=%p, dst_len=%zu, SBError (%p))...",
+ m_opaque_sp.get(),
+ addr,
+ src,
+ (uint32_t) src_len,
+ sb_error.get());
+ }
+
if (IsValid())
{
Error error;
@@ -631,6 +665,20 @@
sb_error.SetError (error);
}
+ if (log)
+ {
+ SBStream sstr;
+ sb_error.GetDescription (sstr);
+ log->Printf ("SBProcess(%p)::WriteMemory (addr=0x%llx, src=%p, dst_len=%zu, SBError (%p): %s) => %d",
+ m_opaque_sp.get(),
+ addr,
+ src,
+ (uint32_t) src_len,
+ sb_error.get(),
+ sstr.GetData(),
+ (uint32_t) bytes_written);
+ }
+
return bytes_written;
}
Modified: lldb/trunk/source/API/SBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbol.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbol.cpp (original)
+++ lldb/trunk/source/API/SBSymbol.cpp Fri Oct 29 23:51:46 2010
@@ -27,16 +27,6 @@
SBSymbol::SBSymbol (lldb_private::Symbol *lldb_object_ptr) :
m_opaque_ptr (lldb_object_ptr)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- {
- SBStream sstr;
- GetDescription (sstr);
- log->Printf ("SBSymbol::SBSymbol (lldb_object_ptr=%p) => this.obj = %p (%s)", lldb_object_ptr, m_opaque_ptr,
- sstr.GetData());
-
- }
}
SBSymbol::~SBSymbol ()
@@ -53,32 +43,27 @@
const char *
SBSymbol::GetName() const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //if (log)
- // log->Printf ("SBSymbol::GetName ()");
-
+ const char *name = NULL;
if (m_opaque_ptr)
- {
- if (log)
- log->Printf ("SBSymbol::GetName (this.obj=%p) => '%s'", m_opaque_ptr,
- m_opaque_ptr->GetMangled().GetName().AsCString());
+ name = m_opaque_ptr->GetMangled().GetName().AsCString();
- return m_opaque_ptr->GetMangled().GetName().AsCString();
- }
-
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBSymbol::GetName (this.obj=%p) => NULL", m_opaque_ptr);
-
- return NULL;
+ log->Printf ("SBSymbol(%p)::GetName () => \"%s\"", m_opaque_ptr, name ? name : "");
+ return name;
}
const char *
SBSymbol::GetMangledName () const
{
+ const char *name = NULL;
if (m_opaque_ptr)
- return m_opaque_ptr->GetMangled().GetMangledName().AsCString();
- return NULL;
+ name = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+ if (log)
+ log->Printf ("SBSymbol(%p)::GetMangledName () => \"%s\"", m_opaque_ptr, name ? name : "");
+
+ return name;
}
Modified: lldb/trunk/source/API/SBSymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbolContext.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbolContext.cpp (original)
+++ lldb/trunk/source/API/SBSymbolContext.cpp Fri Oct 29 23:51:46 2010
@@ -25,26 +25,13 @@
SBSymbolContext::SBSymbolContext (const SymbolContext *sc_ptr) :
m_opaque_ap ()
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
if (sc_ptr)
m_opaque_ap.reset (new SymbolContext (*sc_ptr));
-
- if (log)
- {
- SBStream sstr;
- GetDescription (sstr);
- 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);
-
-
if (rhs.IsValid())
{
if (m_opaque_ap.get())
@@ -52,11 +39,6 @@
else
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 ()
@@ -104,9 +86,6 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBSymbolContext::GetModule ()");
-
SBModule sb_module;
if (m_opaque_ap.get())
sb_module.SetModule(m_opaque_ap->module_sp);
@@ -115,8 +94,8 @@
{
SBStream sstr;
sb_module.GetDescription (sstr);
- log->Printf ("SBSymbolContext::GetModule (this.ap=%p) => SBModule (this.sp = %p, '%s')", m_opaque_ap.get(),
- sb_module.get(), sstr.GetData());
+ log->Printf ("SBSymbolContext(%p)::GetModule () => SBModule(%p): %s",
+ m_opaque_ap.get(), sb_module.get(), sstr.GetData());
}
return sb_module;
@@ -133,13 +112,10 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBSymbolContext::GetFunction ()");
-
SBFunction ret_function (m_opaque_ap.get() ? m_opaque_ap->function : NULL);
if (log)
- log->Printf ("SBSymbolContext::GetFunction (this.ap=%p) => SBFunction (this.obj = %p, '%s')",
+ log->Printf ("SBSymbolContext(%p)::GetFunction () => SBFunction(%p): %s",
m_opaque_ap.get(), ret_function.get(), ret_function.GetName());
return ret_function;
@@ -156,9 +132,6 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBSymbolContext::GetLineEntry ()");
-
SBLineEntry sb_line_entry;
if (m_opaque_ap.get())
sb_line_entry.SetLineEntry (m_opaque_ap->line_entry);
@@ -167,7 +140,7 @@
{
SBStream sstr;
sb_line_entry.GetDescription (sstr);
- log->Printf ("SBSymbolContext::GetLineEntry (this.ap=%p) => SBLineEntry (this.ap = %p, '%s')",
+ log->Printf ("SBSymbolContext(%p)::GetLineEntry () => SBLineEntry(%p): %s",
m_opaque_ap.get(),
sb_line_entry.get(), sstr.GetData());
}
@@ -180,16 +153,13 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //if (log)
- // log->Printf ("SBSymbolContext::GetSymbol ()");
-
SBSymbol ret_symbol (m_opaque_ap.get() ? m_opaque_ap->symbol : NULL);
if (log)
{
SBStream sstr;
ret_symbol.GetDescription (sstr);
- log->Printf ("SBSymbolContext::GetSymbol (this.ap=%p) => SBSymbol (this.ap = %p, '%s')", m_opaque_ap.get(),
+ log->Printf ("SBSymbolContext(%p)::GetSymbol () => SBSymbol(%p): %s", m_opaque_ap.get(),
ret_symbol.get(), sstr.GetData());
}
Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Fri Oct 29 23:51:46 2010
@@ -57,48 +57,31 @@
SBTarget::SBTarget (const SBTarget& rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- {
- SBStream sstr;
- GetDescription (sstr, lldb::eDescriptionLevelBrief);
- log->Printf ("SBTarget::SBTarget (rhs.sp=%p) => SBTarget(%p): %s",
- rhs.m_opaque_sp.get(), m_opaque_sp.get(), sstr.GetData());
- }
+// Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+//
+// if (log)
+// {
+// SBStream sstr;
+// GetDescription (sstr, lldb::eDescriptionLevelBrief);
+// log->Printf ("SBTarget::SBTarget (rhs.sp=%p) => SBTarget(%p): %s",
+// rhs.m_opaque_sp.get(), m_opaque_sp.get(), sstr.GetData());
+// }
}
SBTarget::SBTarget(const TargetSP& target_sp) :
m_opaque_sp (target_sp)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- {
- SBStream sstr;
- GetDescription (sstr, lldb::eDescriptionLevelBrief);
- log->Printf ("SBTarget::SBTarget (target_sp=%p) => SBTarget(%p): '%s'",
- target_sp.get(), m_opaque_sp.get(), sstr.GetData());
- }
-}
-
-const SBTarget&
-SBTarget::Assign (const SBTarget& rhs)
-{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- log->Printf ("SBTarget(%p)::Assign (rhs.sp=%p)", m_opaque_sp.get(), rhs.m_opaque_sp.get());
-
- if (this != &rhs)
- {
- m_opaque_sp = rhs.m_opaque_sp;
- }
-
- return *this;
+// Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+//
+// if (log)
+// {
+// SBStream sstr;
+// GetDescription (sstr, lldb::eDescriptionLevelBrief);
+// log->Printf ("SBTarget::SBTarget (target_sp=%p) => SBTarget(%p): %s",
+// target_sp.get(), m_opaque_sp.get(), sstr.GetData());
+// }
}
-
//----------------------------------------------------------------------
// Destructor
//----------------------------------------------------------------------
@@ -178,7 +161,7 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBTarget(%p)::LaunchProcess (argv=%p, envp=%p, tty='%s', launch_flags=%d, stop_at_entry=%i)",
+ log->Printf ("SBTarget(%p)::LaunchProcess (argv=%p, envp=%p, tty=\"%s\", launch_flags=%d, stop_at_entry=%i)",
m_opaque_sp.get(), argv, envp, tty, launch_flags, stop_at_entry);
SBError sb_error;
@@ -211,7 +194,7 @@
if (log)
{
- log->Printf ("SBTarget(%p)::Launch (argv=%p, envp=%p, tty='%s', launch_flags=%d, stop_at_entry=%i, &error (%p))...",
+ log->Printf ("SBTarget(%p)::Launch (argv=%p, envp=%p, tty=\"%s\", launch_flags=%d, stop_at_entry=%i, &error (%p))...",
m_opaque_sp.get(), argv, envp, tty, launch_flags, stop_at_entry, error.get());
}
SBProcess sb_process;
@@ -429,20 +412,7 @@
SBBreakpoint
SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- SBBreakpoint sb_bp;
- if (file != NULL && line != 0)
- sb_bp = BreakpointCreateByLocation (SBFileSpec (file), line);
-
- if (log)
- {
- SBStream sstr;
- sb_bp.GetDescription (sstr);
- log->Printf("SBTarget(%p)::BreakpointCreateByLocation (file='%s', line=%d) => SBBreakpoint(%p): %s", m_opaque_sp.get(), file, line, sb_bp.get(), sstr.GetData());
- }
-
- return sb_bp;
+ return SBBreakpoint(BreakpointCreateByLocation (SBFileSpec (file), line));
}
SBBreakpoint
@@ -458,8 +428,13 @@
{
SBStream sstr;
sb_bp.GetDescription (sstr);
- log->Printf ("SBTarget(%p)::BreakpointCreateByLocation (sb_file_spec.ap=%p, line=%d) => "
- "SBBreakpoint(%p): %s", m_opaque_sp.get(), sb_file_spec.get(), line, sb_bp.get(),
+ const char *dir = sb_file_spec.GetDirectory();
+ const char *file = sb_file_spec.GetFilename();
+ log->Printf ("SBTarget(%p)::BreakpointCreateByLocation ( %s%s%s:%u ) => SBBreakpoint(%p): %s",
+ m_opaque_sp.get(),
+ dir ? dir : "", dir ? "/" : "", file ? file : "",
+ line,
+ sb_bp.get(),
sstr.GetData());
}
@@ -489,7 +464,7 @@
{
SBStream sstr;
sb_bp.GetDescription (sstr);
- log->Printf ("SBTarget(%p)::BreakpointCreateByName (symbol_name='%s', module_name='%s') => "
+ log->Printf ("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", module=\"%s\") => "
"SBBreakpoint(%p): %s", m_opaque_sp.get(), symbol_name, module_name, sb_bp.get(),
sstr.GetData());
}
@@ -523,7 +498,7 @@
{
SBStream sstr;
sb_bp.GetDescription (sstr);
- log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (symbol_name_regex='%s', module_name='%s') "
+ log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (symbol_regex=\"%s\", module_name=\"%s\") "
"=> SBBreakpoint(%p): %s", m_opaque_sp.get(), symbol_name_regex, module_name,
sb_bp.get(), sstr.GetData());
}
Modified: lldb/trunk/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Fri Oct 29 23:51:46 2010
@@ -49,27 +49,10 @@
SBThread::SBThread (const ThreadSP& lldb_object_sp) :
m_opaque_sp (lldb_object_sp)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- {
- SBStream sstr;
- GetDescription (sstr);
- log->Printf ("SBThread::SBThread (lldb_object_sp=%p) => SBThread(%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);
-
- m_opaque_sp = rhs.m_opaque_sp;
-
- if (log)
- log->Printf ("SBThread::SBThread (rhs.sp=%p) => SBThread(%p)",
- rhs.m_opaque_sp.get(), m_opaque_sp.get());
-
}
//----------------------------------------------------------------------
@@ -106,7 +89,7 @@
}
if (log)
- log->Printf ("SBThread(%p)::GetStopReason () => '%s'", m_opaque_sp.get(),
+ log->Printf ("SBThread(%p)::GetStopReason () => %s", m_opaque_sp.get(),
Thread::StopReasonAsCString (reason));
return reason;
@@ -126,7 +109,7 @@
if (stop_desc)
{
if (log)
- log->Printf ("SBThread(%p)::GetStopDescription (dst, dst_len) => '%s'",
+ log->Printf ("SBThread(%p)::GetStopDescription (dst, dst_len) => \"%s\"",
m_opaque_sp.get(), stop_desc);
if (dst)
return ::snprintf (dst, dst_len, "%s", stop_desc);
@@ -224,15 +207,12 @@
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- //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 (this.sp=%p) => %d", m_opaque_sp.get(), (uint32_t) id);
+ log->Printf ("SBThread(%p)::GetThreadID () => 0x%4.4x", m_opaque_sp.get(), id);
return id;
}
@@ -247,44 +227,29 @@
const char *
SBThread::GetName () const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //if (log)
- // log->Printf ("SBThread::GetName ()");
-
+ const char *name = NULL;
if (m_opaque_sp)
- {
- if (log)
- log->Printf ("SBThread::GetName (this.sp=%p) => '%s'", m_opaque_sp.get(), m_opaque_sp->GetName());
- return m_opaque_sp->GetName();
- }
-
+ name = m_opaque_sp->GetName();
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBThread::GetName (this.sp=%p) => NULL", m_opaque_sp.get());
+ log->Printf ("SBThread(%p)::GetName () => %s", m_opaque_sp.get(), name ? name : "NULL");
- return NULL;
+ return name;
}
const char *
SBThread::GetQueueName () const
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- //if (log)
- // log->Printf ("SBThread::GetQueueName ()");
-
+ const char *name = NULL;
if (m_opaque_sp)
- {
- if (log)
- log->Printf ("SBThread::GetQueueName (this.sp=%p) => '%s'", m_opaque_sp.get(),
- m_opaque_sp->GetQueueName());
- return m_opaque_sp->GetQueueName();
- }
-
+ name = m_opaque_sp->GetQueueName();
+
+ Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBThread::GetQueueName (this.sp=%p) => NULL", m_opaque_sp.get());
+ log->Printf ("SBThread(%p)::GetQueueName () => %s", m_opaque_sp.get(), name ? name : "NULL");
- return NULL;
+ return name;
}
@@ -390,7 +355,7 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
if (log)
- log->Printf ("SBThread::StepOut (this.sp=%p)", m_opaque_sp.get());
+ log->Printf ("SBThread(%p)::StepOut ()", m_opaque_sp.get());
if (m_opaque_sp)
{
@@ -482,7 +447,7 @@
{
SBStream sstr;
process.GetDescription (sstr);
- log->Printf ("SBThread::GetProcess (this.sp=%p) => SBProcess : this.sp = %p, '%s'", m_opaque_sp.get(),
+ log->Printf ("SBThread(%p)::GetProcess () => SBProcess(%p): %s", m_opaque_sp.get(),
process.get(), sstr.GetData());
}
@@ -499,7 +464,7 @@
num_frames = m_opaque_sp->GetStackFrameCount();
if (log)
- log->Printf ("SBThread::GetNumFrames (this.sp=%p) => %d", m_opaque_sp.get(), num_frames);
+ log->Printf ("SBThread(%p)::GetNumFrames () => %u", m_opaque_sp.get(), num_frames);
return num_frames;
}
@@ -517,7 +482,7 @@
{
SBStream sstr;
sb_frame.GetDescription (sstr);
- log->Printf ("SBThread(%p)::GetFrameAtIndex (idx=%d) => SBFrame.sp : this = %p, '%s'",
+ log->Printf ("SBThread(%p)::GetFrameAtIndex (idx=%d) => SBFrame(%p): %s",
m_opaque_sp.get(), idx, sb_frame.get(), sstr.GetData());
}
@@ -527,12 +492,8 @@
const lldb::SBThread &
SBThread::operator = (const lldb::SBThread &rhs)
{
- Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-
- if (log)
- log->Printf ("SBThread(%p)::operator= (rhs.sp=%p)", m_opaque_sp.get(), rhs.m_opaque_sp.get());
-
- m_opaque_sp = rhs.m_opaque_sp;
+ if (this != &rhs)
+ m_opaque_sp = rhs.m_opaque_sp;
return *this;
}
@@ -549,7 +510,7 @@
}
lldb_private::Thread *
-SBThread::GetLLDBObjectPtr ()
+SBThread::get ()
{
return m_opaque_sp.get();
}
@@ -579,20 +540,6 @@
}
bool
-SBThread::GetDescription (SBStream &description)
-{
- if (m_opaque_sp)
- {
- StreamString strm;
- description.Printf("SBThread: tid = 0x%4.4x", m_opaque_sp->GetID());
- }
- else
- description.Printf ("No value");
-
- return true;
-}
-
-bool
SBThread::GetDescription (SBStream &description) const
{
if (m_opaque_sp)
Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=117772&r1=117771&r2=117772&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Fri Oct 29 23:51:46 2010
@@ -80,7 +80,7 @@
}
else
{
- s->Printf ("%s", GetExecutableModule()->GetFileSpec().GetFilename().GetCString());
+ s->PutCString (GetExecutableModule()->GetFileSpec().GetFilename().GetCString());
}
}
More information about the lldb-commits
mailing list