summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2016-03-15 01:57:10 +0000
committerEnrico Granata <egranata@apple.com>2016-03-15 01:57:10 +0000
commitee88b615007d848e3a37bf3b341fc05ea1282b49 (patch)
tree6156027c9072e292162687002c07e4d4aa4b3fe1
parenta4b1ace4610fb6ec2a1d06b3b978285f3dafbb20 (diff)
downloadbcm5719-llvm-ee88b615007d848e3a37bf3b341fc05ea1282b49.tar.gz
bcm5719-llvm-ee88b615007d848e3a37bf3b341fc05ea1282b49.zip
Workaround the fact that "b" is now a separate command object from "_regexp-break", and thus "help b" doesn't show the possible syntaxes
It would be nice to have a longer-term plan for how to handle help for regular expression commands, since their syntax is highly irregular. I can see a few options (*), but for now this is a reasonable stop-gag measure for the most blatant regression. (*) the simplest is, of course, to detect a regex command and inherit the syntax for any aliases thereof; it would be nice if this also didn't show the underlying regex command name when the alias is used llvm-svn: 263523
-rw-r--r--lldb/include/lldb/Interpreter/CommandInterpreter.h2
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h
index a0144000795..137df8e46ed 100644
--- a/lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -278,7 +278,7 @@ public:
bool
UserCommandExists (const char *cmd);
- bool
+ CommandAlias*
AddAlias (const char *alias_name,
lldb::CommandObjectSP& command_obj_sp,
const char *args_string = nullptr);
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 5127d19664f..08c864c1dca 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -217,7 +217,7 @@ CommandInterpreter::Initialize ()
cmd_obj_sp = GetCommandSPExact ("_regexp-break",false);
if (cmd_obj_sp)
- AddAlias ("b", cmd_obj_sp);
+ AddAlias ("b", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
cmd_obj_sp = GetCommandSPExact ("_regexp-tbreak",false);
if (cmd_obj_sp)
@@ -1049,7 +1049,7 @@ CommandInterpreter::UserCommandExists (const char *cmd)
return m_user_dict.find(cmd) != m_user_dict.end();
}
-bool
+CommandAlias*
CommandInterpreter::AddAlias (const char *alias_name,
lldb::CommandObjectSP& command_obj_sp,
const char *args_string)
@@ -1064,11 +1064,11 @@ CommandInterpreter::AddAlias (const char *alias_name,
if (command_alias_up && command_alias_up->IsValid())
{
- m_alias_dict[alias_name] = CommandObjectSP(command_alias_up.release());
- return true;
+ m_alias_dict[alias_name] = CommandObjectSP(command_alias_up.get());
+ return command_alias_up.release();
}
- return false;
+ return nullptr;
}
bool
OpenPOWER on IntegriCloud