aboutsummaryrefslogtreecommitdiff
path: root/lldb/source
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2016-04-20 20:48:05 +0000
committerEnrico Granata <egranata@apple.com>2016-04-20 20:48:05 +0000
commit612917c784dc7b42b3138cae1cc496c877f5d40a (patch)
treebb17cfce3c14971cf9d9c6730817e2536218da7e /lldb/source
parent32773333cbda0c2ca8a643b82fca24a13bc70233 (diff)
downloadllvm-612917c784dc7b42b3138cae1cc496c877f5d40a.zip
llvm-612917c784dc7b42b3138cae1cc496c877f5d40a.tar.gz
llvm-612917c784dc7b42b3138cae1cc496c877f5d40a.tar.bz2
Fix a bug where LLDB would crash if 'apropos <anything>' was used after spawning an inferior process
llvm-svn: 266911
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Commands/CommandObjectMultiword.cpp9
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp2
2 files changed, 10 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index 887ce24..ae19976 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -367,6 +367,15 @@ CommandObjectProxy::IsMultiwordObject ()
return false;
}
+CommandObjectMultiword*
+CommandObjectProxy::GetAsMultiwordCommand ()
+{
+ CommandObject *proxy_command = GetProxyCommandObject();
+ if (proxy_command)
+ return proxy_command->GetAsMultiwordCommand();
+ return nullptr;
+}
+
void
CommandObjectProxy::GenerateHelpText (Stream &result)
{
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 064a95f..b28c44a 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2806,7 +2806,7 @@ CommandInterpreter::FindCommandsForApropos (const char *search_word,
if (cmd_obj->IsMultiwordObject())
{
- CommandObjectMultiword *cmd_multiword = (CommandObjectMultiword*)cmd_obj;
+ CommandObjectMultiword *cmd_multiword = cmd_obj->GetAsMultiwordCommand();
FindCommandsForApropos(search_word,
commands_found,
commands_help,