Author: Jim Ingham Date: 2019-11-07T14:25:04-08:00 New Revision: f1539b9db39a59a5e50c065c39e491ba4f890377
URL: https://github.com/llvm/llvm-project/commit/f1539b9db39a59a5e50c065c39e491ba4f890377 DIFF: https://github.com/llvm/llvm-project/commit/f1539b9db39a59a5e50c065c39e491ba4f890377.diff LOG: BreakpointDummyOptionGroup was using g_breakpoint_modify_options rather than g_breakpoint_dummy_options causing the -D option for breakpoint set command to be incorrectly parsed. Patch by Martin Svensson. Differential Revision: https://reviews.llvm.org/D69425 Added: lldb/test/Shell/Breakpoint/Inputs/dummy-target.c lldb/test/Shell/Breakpoint/dummy-target.test Modified: lldb/source/Commands/CommandObjectBreakpoint.cpp Removed: ################################################################################ diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 5d0cc3d9dcea..380f753ea339 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -180,7 +180,7 @@ class BreakpointDummyOptionGroup : public OptionGroup { ExecutionContext *execution_context) override { Status error; const int short_option = - g_breakpoint_modify_options[option_idx].short_option; + g_breakpoint_dummy_options[option_idx].short_option; switch (short_option) { case 'D': diff --git a/lldb/test/Shell/Breakpoint/Inputs/dummy-target.c b/lldb/test/Shell/Breakpoint/Inputs/dummy-target.c new file mode 100644 index 000000000000..76e8197013aa --- /dev/null +++ b/lldb/test/Shell/Breakpoint/Inputs/dummy-target.c @@ -0,0 +1 @@ +int main() { return 0; } diff --git a/lldb/test/Shell/Breakpoint/dummy-target.test b/lldb/test/Shell/Breakpoint/dummy-target.test new file mode 100644 index 000000000000..873a4d3adc00 --- /dev/null +++ b/lldb/test/Shell/Breakpoint/dummy-target.test @@ -0,0 +1,23 @@ +# RUN: mkdir -p %t +# RUN: cd %t +# RUN: %build %p/Inputs/dummy-target.c -o dummy.out +# RUN: %lldb -b -s %s dummy.out | FileCheck %s + +breakpoint set -D -n main +# CHECK: Breakpoint {{[0-9]}}: no locations (pending). +# CHECK: Breakpoint set in dummy target + +breakpoint list +# CHECK: No breakpoints currently set + +breakpoint list -D +# CHECK: name = 'main', locations = 0 (pending) + +target delete +# CHECK: 1 targets deleted + +target create dummy.out +# CHECK: Current executable set to {{.*}}dummy.out + +breakpoint list +# CHECK: name = 'main', locations = {{[1-9]}} _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits