<rdar://problem/12491387>
I added the ability for a process plug-in to implement custom commands. All the lldb_private::Process plug-in has to do is override:
virtual CommandObject *
GetPluginCommandObject();
This object returned should be a multi-word command that vends LLDB commands. There is a sample implementation in ProcessGDBRemote that is hollowed out. It is intended to be used for sending a custom packet, though the body of the command execute function has yet to be implemented!
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165861 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/CommandObject.cpp b/source/Interpreter/CommandObject.cpp
index 11e90f2..8d8520d 100644
--- a/source/Interpreter/CommandObject.cpp
+++ b/source/Interpreter/CommandObject.cpp
@@ -377,23 +377,19 @@
bool
CommandObject::HelpTextContainsWord (const char *search_word)
{
- const char *short_help;
- const char *long_help;
- const char *syntax_help;
std::string options_usage_help;
-
bool found_word = false;
- short_help = GetHelp();
- long_help = GetHelpLong();
- syntax_help = GetSyntax();
+ const char *short_help = GetHelp();
+ const char *long_help = GetHelpLong();
+ const char *syntax_help = GetSyntax();
- if (strcasestr (short_help, search_word))
+ if (short_help && strcasestr (short_help, search_word))
found_word = true;
- else if (strcasestr (long_help, search_word))
+ else if (long_help && strcasestr (long_help, search_word))
found_word = true;
- else if (strcasestr (syntax_help, search_word))
+ else if (syntax_help && strcasestr (syntax_help, search_word))
found_word = true;
if (!found_word