diff options
author | Jim Ingham <jingham@apple.com> | 2013-05-02 23:15:37 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2013-05-02 23:15:37 +0000 |
commit | 076b7fc6084342c7c4c2e05b1775e001216a914c (patch) | |
tree | d71998b912f9294d8eb780f6f1780d660a8834bc | |
parent | 44dff3f2dc2a0a6cc9e88552187730a2d7ea19bb (diff) | |
download | bcm5719-llvm-076b7fc6084342c7c4c2e05b1775e001216a914c.tar.gz bcm5719-llvm-076b7fc6084342c7c4c2e05b1775e001216a914c.zip |
If HandleCommands is called with add_to_history set to false, turn on the m_command_source_depth so that when we forget the value for regex & alias commands it still stays off.
<rdar://problem/13795202>
llvm-svn: 180971
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index a5e192f472a..103554947bb 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1504,7 +1504,6 @@ CommandInterpreter::HandleCommand (const char *command_line, if (!no_context_switching) UpdateExecutionContext (override_context); - // <rdar://problem/11328896> bool add_to_history; if (lazy_add_to_history == eLazyBoolCalculate) add_to_history = (m_command_source_depth == 0); @@ -2513,10 +2512,17 @@ CommandInterpreter::HandleCommands (const StringList &commands, CommandReturnObject tmp_result; // If override_context is not NULL, pass no_context_switching = true for // HandleCommand() since we updated our context already. + + // We might call into a regex or alias command, in which case the add_to_history will get lost. This + // m_command_source_depth dingus is the way we turn off adding to the history in that case, so set it up here. + if (!add_to_history) + m_command_source_depth++; bool success = HandleCommand(cmd, add_to_history, tmp_result, NULL, /* override_context */ true, /* repeat_on_empty_command */ override_context != NULL /* no_context_switching */); + if (!add_to_history) + m_command_source_depth--; if (print_results) { |