[lldb] [llvm] [llvm][lldb] Add check for incorrect target features (PR #180901)
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 11 02:48:39 PST 2026
================
@@ -0,0 +1,40 @@
+"""
+Test for lldb disassemble command with -Y option and invalid parameters.
+This test verifies that disassemble -Y command properly reports error messages
+when invoked with incorrect options.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import TestBase
+from lldbsuite.test import lldbutil
+
+
+class TestDisassembleInvalidTargetFeatures(TestBase):
+ """Test disassemble -Y option error handling."""
+
+ def run_invalid_disasm_cmd(self, option, expected_error):
+ cmd = f"disassemble -Y {option}"
+ self.runCmd(cmd, check=False)
+ output = self.res.GetOutput()
+ error = self.res.GetError()
+ self.assertFalse(self.res.Succeeded(), f"{cmd} should fail")
+ self.assertTrue(len(error) > 0, f"Error for '{cmd}' should not be empty")
+ self.assertIn(expected_error, error)
+
+ def test_disassemble_Y_invalid_options(self):
+ self.build()
+ _, _, _, _ = lldbutil.run_to_source_breakpoint(
+ self, "main", lldb.SBFileSpec("main.cpp")
+ )
+
+ self.run_invalid_disasm_cmd("", "last option requires an argument")
+ self.run_invalid_disasm_cmd(
+ "invalid", "Unable to find Disassembler plug-in with such parameters:"
+ )
+ self.run_invalid_disasm_cmd(
+ "+invalid_1,-invalid_2,+invalid3", "Failed to disassemble memory at"
----------------
DavidSpickett wrote:
This error doesn't seem very useful just from the bit you're checking for. It did fail but why would be the important bit.
If it's not the thing you're targeting with the PR, fair enough, document the existing behaviour, but otherwise, is there a part of this missing that would help the user?
https://github.com/llvm/llvm-project/pull/180901
More information about the llvm-commits
mailing list