Fix various minor bugs in the Settings stuff.

llvm-svn: 113245
This commit is contained in:
Caroline Tice 2010-09-07 18:35:40 +00:00
parent 41cb55a916
commit 49e2737eb4
4 changed files with 28 additions and 7 deletions

View File

@ -82,7 +82,7 @@ CommandObjectSettingsSet::Execute (CommandInterpreter &interpreter,
const int argc = command.GetArgumentCount ();
if (argc < 2)
if ((argc < 2) && (!m_options.m_reset))
{
result.AppendError ("'settings set' takes more arguments");
result.SetStatus (eReturnStatusFailed);

View File

@ -689,7 +689,16 @@ DebuggerInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var
UserSettingsController::UpdateStringVariable (op, m_prompt, value, err);
if (!pending)
{
BroadcastPromptChange (instance_name, m_prompt.c_str());
// 'instance_name' is actually (probably) in the form '[<instance_name>]'; if so, we need to
// strip off the brackets before passing it to BroadcastPromptChange.
std::string tmp_instance_name (instance_name.AsCString());
if ((tmp_instance_name[0] == '[')
&& (tmp_instance_name[instance_name.GetLength() - 1] == ']'))
tmp_instance_name = tmp_instance_name.substr (1, instance_name.GetLength() - 2);
ConstString new_name (tmp_instance_name.c_str());
BroadcastPromptChange (new_name, m_prompt.c_str());
}
}
else if (var_name == ScriptLangVarName())
@ -746,7 +755,18 @@ DebuggerInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &
m_prompt = new_debugger_settings->m_prompt;
if (!pending)
BroadcastPromptChange (m_instance_name, m_prompt.c_str());
{
// 'instance_name' is actually (probably) in the form '[<instance_name>]'; if so, we need to
// strip off the brackets before passing it to BroadcastPromptChange.
std::string tmp_instance_name (m_instance_name.AsCString());
if ((tmp_instance_name[0] == '[')
&& (tmp_instance_name[m_instance_name.GetLength() - 1] == ']'))
tmp_instance_name = tmp_instance_name.substr (1, m_instance_name.GetLength() - 2);
ConstString new_name (tmp_instance_name.c_str());
BroadcastPromptChange (new_name, m_prompt.c_str());
}
m_script_lang = new_debugger_settings->m_script_lang;
}

View File

@ -1042,13 +1042,14 @@ UserSettingsController::GetAllVariableValues (CommandInterpreter &interpreter,
StringList value = root->GetVariable (full_var_name.GetData(), var_type);
description.Clear();
if (value.GetSize() == 1)
description.Printf ("%s (%s) = %s", full_var_name.GetData(), GetTypeString (entry.var_type),
description.Printf ("%s (%s) = '%s'", full_var_name.GetData(), GetTypeString (entry.var_type),
value.GetStringAtIndex (0));
else
{
description.Printf ("%s (%s) = ", full_var_name.GetData(), GetTypeString (entry.var_type));
description.Printf ("%s (%s) = '", full_var_name.GetData(), GetTypeString (entry.var_type));
for (int j = 0; j < value.GetSize(); ++j)
description.Printf ("%s ", value.GetStringAtIndex (j));
description.Printf ("'");
}
result_stream.Printf ("%s\n", description.GetData());

View File

@ -2196,7 +2196,7 @@ ProcessInstanceSettings::InputPathVarName ()
const ConstString &
ProcessInstanceSettings::OutputPathVarName ()
{
static ConstString output_path_var_name ("output_path");
static ConstString output_path_var_name ("output-path");
return output_path_var_name;
}
@ -2204,7 +2204,7 @@ ProcessInstanceSettings::OutputPathVarName ()
const ConstString &
ProcessInstanceSettings::ErrorPathVarName ()
{
static ConstString error_path_var_name ("error_path");
static ConstString error_path_var_name ("error-path");
return error_path_var_name;
}