Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb/Driver] Fix handling on positional arguments
Before the transition to libOption it was possible to specify arguments for the inferior without -- as long as they didn't start with a dash. For example, the following invocations should all behave the same: $ lldb inferior inferior-arg $ lldb inferior -- inferior-arg $ lldb -- inferior inferior-arg This patch fixes that behavior, documents it and adds a test to cover the different combinations. Differential revision: https://reviews.llvm.org/D80165 (cherry picked from commit 82093e8)
- Loading branch information
1 parent
771a1d8
commit a2a8bac
Showing
4 changed files
with
50 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# RUN: %lldb --no-use-color -s %s | FileCheck %s | ||
# RUN: %lldb --no-use-colors -s %s | FileCheck %s | ||
settings show use-color | ||
# CHECK: use-color (boolean) = false | ||
q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
RUN: echo "int main() { return 0; }" | %clang_host -x c - -o %t.foo | ||
|
||
RUN: %lldb -x -b %t.foo bar baz quux | FileCheck %s | ||
RUN: %lldb -x -b -- %t.foo bar baz quux | FileCheck %s | ||
RUN: %lldb -x -b %t.foo -- bar baz quux | FileCheck %s | ||
RUN: %lldb -x -b %t.foo bar -- baz quux | FileCheck %s | ||
RUN: %lldb -x -b %t.foo bar baz -- quux | FileCheck %s | ||
RUN: %lldb %t.foo -x bar -b baz -- quux | FileCheck %s | ||
RUN: %lldb -x -b -f %t.foo bar baz quux | FileCheck %s | ||
RUN: %lldb -x -b -f %t.foo -- bar baz quux | FileCheck %s | ||
RUN: %lldb -x -b -f %t.foo bar -- baz quux | FileCheck %s | ||
RUN: %lldb -x -b -f %t.foo bar baz -- quux | FileCheck %s | ||
|
||
CHECK: Current executable set to {{.*}}foo | ||
CHECK: target.run-args "bar" "baz" "quux" | ||
|
||
RUN: %lldb -x -b %t.foo -- bar -baz --quux | FileCheck %s --check-prefix DASH | ||
RUN: %lldb -x -b -- %t.foo bar -baz --quux | FileCheck %s --check-prefix DASH | ||
RUN: %lldb -x -b -f %t.foo -- bar -baz --quux | FileCheck %s --check-prefix DASH | ||
|
||
DASH: Current executable set to {{.*}}foo | ||
DASH: target.run-args "bar" "-baz" "--quux" | ||
|
||
RUN: %lldb -x -b %t.foo bar -baz --quux 2>&1 | FileCheck %s --check-prefix UNKNOWN | ||
RUN: %lldb -x -b -f %t.foo bar -baz --quux 2>&1 | FileCheck %s --check-prefix UNKNOWN | ||
|
||
UNKNOWN: warning: ignoring unknown option: -baz | ||
UNKNOWN: warning: ignoring unknown option: --quux | ||
UNKNOWN: Current executable set to {{.*}}foo | ||
UNKNOWN: target.run-args "bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters