Add API logging to SBCommandInterpreter::HandleCompletion().
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159180 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBCommandInterpreter.cpp b/source/API/SBCommandInterpreter.cpp
index 31ecfc5..7d76212 100644
--- a/source/API/SBCommandInterpreter.cpp
+++ b/source/API/SBCommandInterpreter.cpp
@@ -123,6 +123,7 @@
int max_return_elements,
SBStringList &matches)
{
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int num_completions = 0;
// Sanity check the arguments that are passed in:
@@ -137,6 +138,10 @@
if (cursor - current_line > current_line_size || last_char - current_line > current_line_size)
return 0;
+ if (log)
+ log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %ld, last char at: %ld, match_start_point: %d, max_return_elements: %d)",
+ m_opaque_ptr, current_line, cursor - current_line, last_char - current_line, match_start_point, max_return_elements);
+
if (m_opaque_ptr)
{
lldb_private::StringList lldb_matches;
@@ -146,6 +151,9 @@
SBStringList temp_list (&lldb_matches);
matches.AppendList (temp_list);
}
+ if (log)
+ log->Printf ("SBCommandInterpreter(%p)::HandleCompletion - Found %d completions.", m_opaque_ptr, num_completions);
+
return num_completions;
}