aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-02-21 02:23:08 +0000
committerJim Ingham <jingham@apple.com>2012-02-21 02:23:08 +0000
commit228063cd21c4e13aba0ef7a4522b1f32e3116c18 (patch)
tree73697c5ec27b8e8f282974db7db4f18de99b770b /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
parent926410d2db727c5093bda792cb8b2025d7f02cc3 (diff)
downloadllvm-228063cd21c4e13aba0ef7a4522b1f32e3116c18.zip
llvm-228063cd21c4e13aba0ef7a4522b1f32e3116c18.tar.gz
llvm-228063cd21c4e13aba0ef7a4522b1f32e3116c18.tar.bz2
Add a logging mode that takes a callback and flush'es to that callback.
Also add SB API's to set this callback, and to enable the log channels. llvm-svn: 151018
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
index 7fd5802..f16966b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
@@ -43,20 +43,19 @@ ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (uint32_t mask)
}
void
-ProcessGDBRemoteLog::DisableLog (Args &args, Stream *feedback_strm)
+ProcessGDBRemoteLog::DisableLog (const char **categories, Stream *feedback_strm)
{
LogSP log (GetLog ());
if (log)
{
uint32_t flag_bits = 0;
- const size_t argc = args.GetArgumentCount ();
- if (argc > 0)
+ if (categories[0] != NULL)
{
flag_bits = log->GetMask().Get();
- for (size_t i = 0; i < argc; ++i)
+ for (size_t i = 0; categories[i] != NULL; ++i)
{
- const char *arg = args.GetArgumentAtIndex (i);
+ const char *arg = categories[i];
if (::strcasecmp (arg, "all") == 0 ) flag_bits &= ~GDBR_LOG_ALL;
@@ -92,7 +91,7 @@ ProcessGDBRemoteLog::DisableLog (Args &args, Stream *feedback_strm)
}
LogSP
-ProcessGDBRemoteLog::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, Args &args, Stream *feedback_strm)
+ProcessGDBRemoteLog::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm)
{
// Try see if there already is a log - that way we can reuse its settings.
// We could reuse the log in toto, but we don't know that the stream is the same.
@@ -111,10 +110,9 @@ ProcessGDBRemoteLog::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, A
if (log)
{
bool got_unknown_category = false;
- const size_t argc = args.GetArgumentCount();
- for (size_t i=0; i<argc; ++i)
+ for (size_t i=0; categories[i] != NULL; ++i)
{
- const char *arg = args.GetArgumentAtIndex(i);
+ const char *arg = categories[i];
if (::strcasecmp (arg, "all") == 0 ) flag_bits |= GDBR_LOG_ALL;
else if (::strcasecmp (arg, "async") == 0 ) flag_bits |= GDBR_LOG_ASYNC;