diff options
author | Johnny Chen <johnny.chen@apple.com> | 2012-01-20 23:02:51 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2012-01-20 23:02:51 +0000 |
commit | 98aceb08f8d4e44fd7c397ba80de8942a48d0fb8 (patch) | |
tree | c07c501cc418080e4f6888738012ced4bf606f94 /lldb/source/Core/UserSettingsController.cpp | |
parent | 30398dd4108f8c5376e863ca665e29098f68db57 (diff) | |
download | bcm5719-llvm-98aceb08f8d4e44fd7c397ba80de8942a48d0fb8.tar.gz bcm5719-llvm-98aceb08f8d4e44fd7c397ba80de8942a48d0fb8.zip |
o CommandObjectSettingsSet.cpp:
Fix a bug where "settings set -r th" wouldn't complete.
o UserSettingsController.cpp:
Fix a bug where "settings set target.process." wouldn't complete.
o test/functionalities/completion:
Add various completion test cases related to 'settings set' command.
llvm-svn: 148596
Diffstat (limited to 'lldb/source/Core/UserSettingsController.cpp')
-rw-r--r-- | lldb/source/Core/UserSettingsController.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lldb/source/Core/UserSettingsController.cpp b/lldb/source/Core/UserSettingsController.cpp index 65c263f396e..de3a71dd59e 100644 --- a/lldb/source/Core/UserSettingsController.cpp +++ b/lldb/source/Core/UserSettingsController.cpp @@ -1714,19 +1714,21 @@ UserSettingsController::CompleteSettingsNames (const UserSettingsControllerSP& u } + // The variable my_usc_sp keeps track of the user settings controller as + // we descend through the tree hierarchy. + UserSettingsControllerSP my_usc_sp = usc_sp; for (int i = 0; i < num_extra_levels; ++i) { ConstString child_level (partial_setting_name_pieces.GetArgumentAtIndex (0)); bool found = false; - int num_children = usc_sp->GetNumChildren(); - UserSettingsControllerSP child_usc_sp = usc_sp; + int num_children = my_usc_sp->GetNumChildren(); for (int j = 0; j < num_children && !found; ++j) { - if (child_usc_sp->GetChildAtIndex (j)->GetLevelName() == child_level) + if (my_usc_sp->GetChildAtIndex (j)->GetLevelName() == child_level) { found = true; - child_usc_sp = child_usc_sp->GetChildAtIndex (j); + my_usc_sp = my_usc_sp->GetChildAtIndex (j); partial_setting_name_pieces.Shift(); } } @@ -1750,15 +1752,15 @@ UserSettingsController::CompleteSettingsNames (const UserSettingsControllerSP& u // 'next_name' is an instance name. The last name piece must be a non-empty partial match against an // instance_name, assuming 'next_name' is valid. - if (usc_sp->IsLiveInstance (next_name)) + if (my_usc_sp->IsLiveInstance (next_name)) { std::string complete_prefix; - usc_sp->BuildParentPrefix (complete_prefix); + my_usc_sp->BuildParentPrefix (complete_prefix); - num_matches = usc_sp->InstanceVariableMatches(partial_setting_name_pieces.GetArgumentAtIndex(0), - complete_prefix, - next_name.c_str(), - matches); + num_matches = my_usc_sp->InstanceVariableMatches(partial_setting_name_pieces.GetArgumentAtIndex(0), + complete_prefix, + next_name.c_str(), + matches); word_complete = true; if (num_matches > 1) word_complete = false; @@ -1772,14 +1774,14 @@ UserSettingsController::CompleteSettingsNames (const UserSettingsControllerSP& u { // 'next_name' must be a child name. Find the correct child and pass the remaining piece to be resolved. bool found = false; - int num_children = usc_sp->GetNumChildren(); + int num_children = my_usc_sp->GetNumChildren(); ConstString child_level (next_name.c_str()); for (int i = 0; i < num_children; ++i) { - if (usc_sp->GetChildAtIndex (i)->GetLevelName() == child_level) + if (my_usc_sp->GetChildAtIndex (i)->GetLevelName() == child_level) { found = true; - return UserSettingsController::CompleteSettingsNames (usc_sp->GetChildAtIndex (i), + return UserSettingsController::CompleteSettingsNames (my_usc_sp->GetChildAtIndex (i), partial_setting_name_pieces, word_complete, matches); } |