diff options
author | Caroline Tice <ctice@apple.com> | 2010-09-20 20:44:43 +0000 |
---|---|---|
committer | Caroline Tice <ctice@apple.com> | 2010-09-20 20:44:43 +0000 |
commit | daccaa9e83e497c761d2012461c83947826be68d (patch) | |
tree | 00066f13e4de1e161ce0a880f1a7f5cba2c22a46 /lldb/source/Commands/CommandObjectSettings.cpp | |
parent | c9cb0caeb7be722d906c5c3fa53adb7d04a9c8e9 (diff) | |
download | bcm5719-llvm-daccaa9e83e497c761d2012461c83947826be68d.tar.gz bcm5719-llvm-daccaa9e83e497c761d2012461c83947826be68d.zip |
Add UserSettings to Target class, making Target settings
the parent of Process settings; add 'default-arch' as a
class-wide setting for Target. Replace lldb::GetDefaultArchitecture
with Target::GetDefaultArchitecture & Target::SetDefaultArchitecture.
Add 'use-external-editor' as user setting to Debugger class & update
code appropriately.
Add Error parameter to methods that get user settings, for easier
reporting of bad requests.
Fix various other minor related bugs.
Fix test cases to work with new changes.
llvm-svn: 114352
Diffstat (limited to 'lldb/source/Commands/CommandObjectSettings.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectSettings.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp index b1bdaaa1b0d..f74bb70ad4b 100644 --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -272,7 +272,7 @@ CommandObjectSettingsShow::~CommandObjectSettingsShow() bool -CommandObjectSettingsShow::Execute ( Args& command, +CommandObjectSettingsShow::Execute (Args& command, CommandReturnObject &result) { UserSettingsControllerSP root_settings = Debugger::GetSettingsController (); @@ -285,13 +285,13 @@ CommandObjectSettingsShow::Execute ( Args& command, // The user requested to see the value of a particular variable. lldb::SettableVariableType var_type; const char *variable_name = command.GetArgumentAtIndex (0); - StringList value = root_settings->GetVariable (variable_name, var_type, - m_interpreter.GetDebugger().GetInstanceName().AsCString()); + StringList value = root_settings->GetVariable (variable_name, var_type, + m_interpreter.GetDebugger().GetInstanceName().AsCString(), + err); - if (value.GetSize() == 0) + if (err.Fail ()) { - result.AppendErrorWithFormat ("Unable to find variable named '%s'. " - "Try 'show' to see all variable values.\n", variable_name); + result.AppendError (err.AsCString()); result.SetStatus (eReturnStatusFailed); } @@ -304,8 +304,10 @@ CommandObjectSettingsShow::Execute ( Args& command, tmp_str.Printf (" (%s)", UserSettingsController::GetTypeString (var_type)); type_name = (char *) tmp_str.GetData(); } - - if (value.GetSize() == 1) + + if (value.GetSize() == 0) + result.AppendMessageWithFormat ("%s%s = ''\n", variable_name, type_name); + else if (value.GetSize() == 1) result.AppendMessageWithFormat ("%s%s = '%s'\n", variable_name, type_name, value.GetStringAtIndex (0)); else { |