diff options
author | Caroline Tice <ctice@apple.com> | 2010-10-26 03:11:13 +0000 |
---|---|---|
committer | Caroline Tice <ctice@apple.com> | 2010-10-26 03:11:13 +0000 |
commit | ceb6b1393d05e3f5a7a235fd34bcf5d74ecc1f8d (patch) | |
tree | d49e665f965c7acfc1d122c6c5e1b128a7ef9d5a /lldb/source/API/SBBroadcaster.cpp | |
parent | e96b8d7ab66051f9fcbac5dfffd8dff7544a2909 (diff) | |
download | bcm5719-llvm-ceb6b1393d05e3f5a7a235fd34bcf5d74ecc1f8d.tar.gz bcm5719-llvm-ceb6b1393d05e3f5a7a235fd34bcf5d74ecc1f8d.zip |
First pass at adding logging capabilities for the API functions. At the moment
it logs the function calls, their arguments and the return values. This is not
complete or polished, but I am committing it now, at the request of someone who
really wants to use it, even though it's not really done. It currently does not
attempt to log all the functions, just the most important ones. I will be
making further adjustments to the API logging code over the next few days/weeks.
(Suggestions for improvements are welcome).
Update the Python build scripts to re-build the swig C++ file whenever
the python-extensions.swig file is modified.
Correct the help for 'log enable' command (give it the correct number & type of
arguments).
llvm-svn: 117349
Diffstat (limited to 'lldb/source/API/SBBroadcaster.cpp')
-rw-r--r-- | lldb/source/API/SBBroadcaster.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/API/SBBroadcaster.cpp b/lldb/source/API/SBBroadcaster.cpp index bbad8e2c5d3..8368135a2e0 100644 --- a/lldb/source/API/SBBroadcaster.cpp +++ b/lldb/source/API/SBBroadcaster.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/Broadcaster.h" +#include "lldb/Core/Log.h" #include "lldb/lldb-forward-rtti.h" #include "lldb/API/SBBroadcaster.h" @@ -22,6 +23,10 @@ SBBroadcaster::SBBroadcaster () : m_opaque (NULL), m_opaque_owned (false) { + Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE); + + if (log) + log->Printf ("SBBroadcastetr::SBBroadcaster () ==> this = %p", this); } @@ -29,12 +34,22 @@ SBBroadcaster::SBBroadcaster (const char *name) : m_opaque (new Broadcaster (name)), m_opaque_owned (true) { + 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)", + name, this, m_opaque); } SBBroadcaster::SBBroadcaster (lldb_private::Broadcaster *broadcaster, bool owns) : m_opaque (broadcaster), m_opaque_owned (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); } SBBroadcaster::~SBBroadcaster() @@ -45,6 +60,11 @@ SBBroadcaster::~SBBroadcaster() void SBBroadcaster::BroadcastEventByType (uint32_t event_type, bool unique) { + Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API); + + if (log) + log->Printf ("SBBroadcaster::BroadcastEventByType (%d, %s)", event_type, (unique ? "true" : "false")); + if (m_opaque == NULL) return; |