Skip to content

[lldb] Use validation combination of options in TestAbbreviations #125270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

JDevlieghere
Copy link
Member

@JDevlieghere JDevlieghere commented Jan 31, 2025

Name and line number are part of different option groups and are not compatible.

(lldb) breakpoint set -n foo -l 10
error: invalid combination of options for the given command

The help output for breakpoint set confirms this. This patch updates the test to use two compatible options. With the improved error reporting from #125125 this becomes an issue.

Name and line number are part of different option groups and are not
compatible.

  (lldb) breakpoint set -n foo -l 10
  error: invalid combination of options for the given command

The help output for `breakpoint set` confirms this. This patch updates
the test to use two compatible options. With the improved error
reporting from llvm#125125 this becomes an issue.
@llvmbot
Copy link
Member

llvmbot commented Jan 31, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

Name and line number are part of different option groups and are not compatible.

(lldb) breakpoint set -n foo -l 10
error: invalid combination of options for the given command

The help output for breakpoint set confirms this. This patch updates the test to use two compatible options. With the improved error reporting from #125125 this becomes an issue.


Full diff: https://github.com/llvm/llvm-project/pull/125270.diff

1 Files Affected:

  • (modified) lldb/test/API/functionalities/abbreviation/TestAbbreviations.py (+4-4)
diff --git a/lldb/test/API/functionalities/abbreviation/TestAbbreviations.py b/lldb/test/API/functionalities/abbreviation/TestAbbreviations.py
index a8cbffbb7ba4a5..bef159501c6cd1 100644
--- a/lldb/test/API/functionalities/abbreviation/TestAbbreviations.py
+++ b/lldb/test/API/functionalities/abbreviation/TestAbbreviations.py
@@ -45,10 +45,10 @@ def test_command_abbreviations_and_aliases(self):
 
         # Make sure an unabbreviated command is not mangled.
         command_interpreter.ResolveCommand(
-            "breakpoint set --name main --line 123", result
+            "breakpoint set --name main --ignore-count 123", result
         )
         self.assertTrue(result.Succeeded())
-        self.assertEqual("breakpoint set --name main --line 123", result.GetOutput())
+        self.assertEqual("breakpoint set --name main --ignore-count 123", result.GetOutput())
 
         # Create some aliases.
         self.runCmd("com a alias com al")
@@ -72,10 +72,10 @@ def test_command_abbreviations_and_aliases(self):
             "process launch -s -o /dev/tty0 -e /dev/tty0", result.GetOutput()
         )
 
-        self.runCmd("alias xyzzy breakpoint set -n %1 -l %2")
+        self.runCmd("alias xyzzy breakpoint set -n %1 -i %2")
         command_interpreter.ResolveCommand("xyzzy main 123", result)
         self.assertTrue(result.Succeeded())
-        self.assertEqual("breakpoint set -n main -l 123", result.GetOutput().strip())
+        self.assertEqual("breakpoint set -n main -i 123", result.GetOutput().strip())
 
         # And again, without enough parameters.
         command_interpreter.ResolveCommand("xyzzy main", result)

Copy link

github-actions bot commented Jan 31, 2025

✅ With the latest revision this PR passed the Python code formatter.

Copy link
Collaborator

@jimingham jimingham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy that you can make ResolveCommand fail on commands that aren't valid! These tests clearly thought they were making up a legal command string, so this change expresses better what the test intends anyway.

@JDevlieghere JDevlieghere merged commit dbabad0 into llvm:main Jan 31, 2025
5 of 6 checks passed
@JDevlieghere JDevlieghere deleted the TestAbbreviations branch January 31, 2025 19:57
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Feb 5, 2025
…vm#125270)

Name and line number are part of different option groups and are not
compatible.

```
(lldb) breakpoint set -n foo -l 10
error: invalid combination of options for the given command
```

The help output for `breakpoint set` confirms this. This patch updates
the test to use two compatible options. With the improved error
reporting from llvm#125125 this becomes an issue.

(cherry picked from commit dbabad0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants