[Lldb-commits] [PATCH] D61406: [CommandObjectCommands] Honor stop-command-source-on-error

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 1 16:00:52 PDT 2019


JDevlieghere updated this revision to Diff 197662.
JDevlieghere retitled this revision from "Watchpoint test + stop-command-source-on-error fix combo" to "[CommandObjectCommands] Honor stop-command-source-on-error ".
JDevlieghere edited the summary of this revision.
JDevlieghere added a comment.

Add dedicated test


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61406/new/

https://reviews.llvm.org/D61406

Files:
  lldb/lit/Commands/command-source.test
  lldb/source/Commands/CommandObjectCommands.cpp


Index: lldb/source/Commands/CommandObjectCommands.cpp
===================================================================
--- lldb/source/Commands/CommandObjectCommands.cpp
+++ lldb/source/Commands/CommandObjectCommands.cpp
@@ -309,8 +309,13 @@
         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()) {
Index: lldb/lit/Commands/command-source.test
===================================================================
--- /dev/null
+++ lldb/lit/Commands/command-source.test
@@ -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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61406.197662.patch
Type: text/x-patch
Size: 1726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190501/7bb219b1/attachment.bin>


More information about the lldb-commits mailing list