[CommandObjectCommands] Honor stop-command-source-on-error

This patch ensures that we honor the stop-command-source-on-error
setting from `command source`. The problem is that we didn't
differentiate between the boolean value being true or false, or not
being set. For the latter scenario, we should calculate the value in the
command interpreter based on the global options.

Differential revision: https://reviews.llvm.org/D61406

llvm-svn: 359750
This commit is contained in:
Jonas Devlieghere
2019-05-02 01:54:02 +00:00
parent 413517ecfe
commit 1c19b74cef
2 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
# Check that stop command source on error.
# RUN: %lldb -x -b -o "command source -e 1 %s" 2>&1 | FileCheck %s --check-prefix STOP
# RUN: %lldb -x -b -o "command source -e 0 %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error true' -o "command source %s" 2>&1 | FileCheck %s --check-prefix STOP
# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error false' -o "command source %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
bogus
p 10+1
# CONTINUE: 11
# STOP-NOT: 11

View File

@@ -309,8 +309,13 @@ protected:
m_options.m_stop_on_continue.OptionWasSet()) {
// Use user set settings
CommandInterpreterRunOptions options;
options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
if (m_options.m_stop_on_continue.OptionWasSet())
options.SetStopOnContinue(
m_options.m_stop_on_continue.GetCurrentValue());
if (m_options.m_stop_on_error.OptionWasSet())
options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
// Individual silent setting is override for global command echo settings.
if (m_options.m_silent_run.GetCurrentValue()) {