forked from OSchip/llvm-project
Fix some occurrences of passing StringRef to Printf.
Hopefully these will all disappear in the future once we move to formatv. llvm-svn: 289168
This commit is contained in:
parent
e9492f7239
commit
867e7d1765
|
@ -51,11 +51,10 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
|
|||
const size_t argc = args.GetArgumentCount();
|
||||
|
||||
if (argc == 1) {
|
||||
const char *search_word = args.GetArgumentAtIndex(0);
|
||||
if ((search_word != nullptr) && (strlen(search_word) > 0)) {
|
||||
auto search_word = args[0].ref;
|
||||
if (!search_word.empty()) {
|
||||
// The bulk of the work must be done inside the Command Interpreter, since
|
||||
// the command dictionary
|
||||
// is private.
|
||||
// the command dictionary is private.
|
||||
StringList commands_found;
|
||||
StringList commands_help;
|
||||
|
||||
|
@ -66,11 +65,11 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
|
|||
result.AppendMessageWithFormat("No commands found pertaining to '%s'. "
|
||||
"Try 'help' to see a complete list of "
|
||||
"debugger commands.\n",
|
||||
search_word);
|
||||
args[0].c_str());
|
||||
} else {
|
||||
if (commands_found.GetSize() > 0) {
|
||||
result.AppendMessageWithFormat(
|
||||
"The following commands may relate to '%s':\n", search_word);
|
||||
"The following commands may relate to '%s':\n", args[0].c_str());
|
||||
size_t max_len = 0;
|
||||
|
||||
for (size_t i = 0; i < commands_found.GetSize(); ++i) {
|
||||
|
@ -93,7 +92,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
|
|||
const bool dump_qualified_name = true;
|
||||
result.AppendMessageWithFormat(
|
||||
"\nThe following settings variables may relate to '%s': \n\n",
|
||||
search_word);
|
||||
args[0].c_str());
|
||||
for (size_t i = 0; i < num_properties; ++i)
|
||||
properties[i]->DumpDescription(
|
||||
m_interpreter, result.GetOutputStream(), 0, dump_qualified_name);
|
||||
|
|
|
@ -840,7 +840,7 @@ protected:
|
|||
result.AppendErrorWithFormat(
|
||||
"'%s' is not a known command.\nTry 'help' to see a "
|
||||
"current list of commands.\n",
|
||||
command_name);
|
||||
args[0].c_str());
|
||||
result.SetStatus(eReturnStatusFailed);
|
||||
return false;
|
||||
}
|
||||
|
@ -850,11 +850,11 @@ protected:
|
|||
result.AppendErrorWithFormat(
|
||||
"'%s' is not an alias, it is a debugger command which can be "
|
||||
"removed using the 'command delete' command.\n",
|
||||
command_name);
|
||||
args[0].c_str());
|
||||
} else {
|
||||
result.AppendErrorWithFormat(
|
||||
"'%s' is a permanent debugger command and cannot be removed.\n",
|
||||
command_name);
|
||||
args[0].c_str());
|
||||
}
|
||||
result.SetStatus(eReturnStatusFailed);
|
||||
return false;
|
||||
|
@ -863,10 +863,11 @@ protected:
|
|||
if (!m_interpreter.RemoveAlias(command_name)) {
|
||||
if (m_interpreter.AliasExists(command_name))
|
||||
result.AppendErrorWithFormat(
|
||||
"Error occurred while attempting to unalias '%s'.\n", command_name);
|
||||
"Error occurred while attempting to unalias '%s'.\n",
|
||||
args[0].c_str());
|
||||
else
|
||||
result.AppendErrorWithFormat("'%s' is not an existing alias.\n",
|
||||
command_name);
|
||||
args[0].c_str());
|
||||
result.SetStatus(eReturnStatusFailed);
|
||||
return false;
|
||||
}
|
||||
|
@ -932,7 +933,7 @@ protected:
|
|||
if (!m_interpreter.RemoveCommand(command_name)) {
|
||||
result.AppendErrorWithFormat(
|
||||
"'%s' is a permanent debugger command and cannot be removed.\n",
|
||||
command_name);
|
||||
args[0].c_str());
|
||||
result.SetStatus(eReturnStatusFailed);
|
||||
return false;
|
||||
}
|
||||
|
@ -1882,7 +1883,7 @@ protected:
|
|||
|
||||
if (cmd_name.empty() || !m_interpreter.HasUserCommands() ||
|
||||
!m_interpreter.UserCommandExists(cmd_name)) {
|
||||
result.AppendErrorWithFormat("command %s not found", cmd_name);
|
||||
result.AppendErrorWithFormat("command %s not found", command[0].c_str());
|
||||
result.SetStatus(eReturnStatusFailed);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ protected:
|
|||
if (command.GetArgumentCount() > 1) {
|
||||
result.AppendErrorWithFormat(
|
||||
"too many arguments; expected frame-index, saw '%s'.\n",
|
||||
command.GetArgumentAtIndex(0));
|
||||
command[0].c_str());
|
||||
m_options.GenerateOptionUsage(
|
||||
result.GetErrorStream(), this,
|
||||
GetCommandInterpreter().GetDebugger().GetTerminalWidth());
|
||||
|
|
Loading…
Reference in New Issue