diff options
| author | Caroline Tice <ctice@apple.com> | 2010-09-07 18:35:40 +0000 |
|---|---|---|
| committer | Caroline Tice <ctice@apple.com> | 2010-09-07 18:35:40 +0000 |
| commit | 49e2737eb482affe4ef15f9972950d4e266037ee (patch) | |
| tree | 80d3a27004cfbf39aa911145b228db96be2fea36 /lldb/source/Core/Debugger.cpp | |
| parent | 41cb55a916dd275f1f7c33d8cde31bbf90ae84d9 (diff) | |
| download | bcm5719-llvm-49e2737eb482affe4ef15f9972950d4e266037ee.tar.gz bcm5719-llvm-49e2737eb482affe4ef15f9972950d4e266037ee.zip | |
Fix various minor bugs in the Settings stuff.
llvm-svn: 113245
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
| -rw-r--r-- | lldb/source/Core/Debugger.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 9ccd2c16612..aa7d08a8827 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -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; } |

