[Lldb-commits] [lldb] [lldb] Restrict TestVariableAnnotationsDisassembler.py to ELF x86_64 (skip on Windows/COFF) (PR #156026)
Abdullah Mohammad Amin via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 29 08:19:25 PDT 2025
https://github.com/UltimateForce21 updated https://github.com/llvm/llvm-project/pull/156026
>From f7bf713975b170dcd061db33a6bea31d13696990 Mon Sep 17 00:00:00 2001
From: Abdullah Amin <abdullahmohammad155 at gmail.com>
Date: Fri, 29 Aug 2025 09:48:05 -0400
Subject: [PATCH 1/3] [lldb] Restrict TestVariableAnnotationsDisassembler.py to
ELF x86_64 (skip on Windows/COFF)
The test assembles `d_original_example.s`, which contains ELF-specific
directives (e.g. `.ident`, `.note.GNU-stack`, `.debug_*` sections).
These fail on Windows/COFF even on x86_64.
Gate the test to x86_64 on ELF platforms (Linux/FreeBSD/NetBSD).
---
.../TestVariableAnnotationsDisassembler.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py b/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
index 4d99ea771605a..c3873f1e6e943 100644
--- a/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
+++ b/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
@@ -22,6 +22,8 @@ def _disassemble_verbose_symbol(self, symname):
self.runCmd(f"disassemble -n {symname} -v", check=True)
return self.res.GetOutput()
+ @skipIfWindows
+ @skipUnlessPlatform(["linux","freebsd","netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_d_original_example_O1(self):
obj = self._build_obj("d_original_example.o")
@@ -34,6 +36,8 @@ def test_d_original_example_O1(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
+ @skipIfWindows
+ @skipUnlessPlatform(["linux","freebsd","netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_int_params(self):
obj = self._build_obj("regs_int_params.o")
@@ -49,6 +53,8 @@ def test_regs_int_params(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
+ @skipIfWindows
+ @skipUnlessPlatform(["linux","freebsd","netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_fp_params(self):
obj = self._build_obj("regs_fp_params.o")
@@ -64,6 +70,8 @@ def test_regs_fp_params(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
+ @skipIfWindows
+ @skipUnlessPlatform(["linux","freebsd","netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_mixed_params(self):
obj = self._build_obj("regs_mixed_params.o")
@@ -79,6 +87,8 @@ def test_regs_mixed_params(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
+ @skipIfWindows
+ @skipUnlessPlatform(["linux","freebsd","netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_live_across_call(self):
obj = self._build_obj("live_across_call.o")
@@ -91,6 +101,8 @@ def test_live_across_call(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
+ @skipIfWindows
+ @skipUnlessPlatform(["linux","freebsd","netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_loop_reg_rotate(self):
obj = self._build_obj("loop_reg_rotate.o")
@@ -105,6 +117,8 @@ def test_loop_reg_rotate(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
+ @skipIfWindows
+ @skipUnlessPlatform(["linux","freebsd","netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_seed_reg_const_undef(self):
obj = self._build_obj("seed_reg_const_undef.o")
>From af6e1be69bb741c093844843b2653279ef2307ec Mon Sep 17 00:00:00 2001
From: Abdullah Amin <abdullahmohammad155 at gmail.com>
Date: Fri, 29 Aug 2025 09:57:07 -0400
Subject: [PATCH 2/3] Formatting change to pass darker.
---
.../TestVariableAnnotationsDisassembler.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py b/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
index c3873f1e6e943..100a935edfd0e 100644
--- a/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
+++ b/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
@@ -23,7 +23,7 @@ def _disassemble_verbose_symbol(self, symname):
return self.res.GetOutput()
@skipIfWindows
- @skipUnlessPlatform(["linux","freebsd","netbsd"])
+ @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_d_original_example_O1(self):
obj = self._build_obj("d_original_example.o")
@@ -37,7 +37,7 @@ def test_d_original_example_O1(self):
@no_debug_info_test
@skipIfWindows
- @skipUnlessPlatform(["linux","freebsd","netbsd"])
+ @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_int_params(self):
obj = self._build_obj("regs_int_params.o")
@@ -54,7 +54,7 @@ def test_regs_int_params(self):
@no_debug_info_test
@skipIfWindows
- @skipUnlessPlatform(["linux","freebsd","netbsd"])
+ @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_fp_params(self):
obj = self._build_obj("regs_fp_params.o")
@@ -71,7 +71,7 @@ def test_regs_fp_params(self):
@no_debug_info_test
@skipIfWindows
- @skipUnlessPlatform(["linux","freebsd","netbsd"])
+ @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_mixed_params(self):
obj = self._build_obj("regs_mixed_params.o")
@@ -88,7 +88,7 @@ def test_regs_mixed_params(self):
@no_debug_info_test
@skipIfWindows
- @skipUnlessPlatform(["linux","freebsd","netbsd"])
+ @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_live_across_call(self):
obj = self._build_obj("live_across_call.o")
@@ -102,7 +102,7 @@ def test_live_across_call(self):
@no_debug_info_test
@skipIfWindows
- @skipUnlessPlatform(["linux","freebsd","netbsd"])
+ @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_loop_reg_rotate(self):
obj = self._build_obj("loop_reg_rotate.o")
@@ -118,7 +118,7 @@ def test_loop_reg_rotate(self):
@no_debug_info_test
@skipIfWindows
- @skipUnlessPlatform(["linux","freebsd","netbsd"])
+ @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_seed_reg_const_undef(self):
obj = self._build_obj("seed_reg_const_undef.o")
>From b78263d9922f6755344827fe7f175b5446a17ee5 Mon Sep 17 00:00:00 2001
From: Abdullah Amin <abdullahmohammad155 at gmail.com>
Date: Fri, 29 Aug 2025 11:18:08 -0400
Subject: [PATCH 3/3] Apply class-level skip to
TestVariableAnnotationsDisassembler
This change moves the platform skip logic to the test class instead of
repeating it for each method.
---
.../TestVariableAnnotationsDisassembler.py | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py b/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
index 100a935edfd0e..f107efbddddeb 100644
--- a/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
+++ b/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
@@ -5,6 +5,9 @@
import re
+# Requires ELF assembler directives (.section … @progbits, .ident, etc.);
+# not compatible with COFF/Mach-O toolchains.
+ at skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
class TestVariableAnnotationsDisassembler(TestBase):
def _build_obj(self, obj_name: str) -> str:
# Let the Makefile build all .o’s (pattern rule). Then grab the one we need.
@@ -22,8 +25,6 @@ def _disassemble_verbose_symbol(self, symname):
self.runCmd(f"disassemble -n {symname} -v", check=True)
return self.res.GetOutput()
- @skipIfWindows
- @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_d_original_example_O1(self):
obj = self._build_obj("d_original_example.o")
@@ -36,8 +37,6 @@ def test_d_original_example_O1(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
- @skipIfWindows
- @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_int_params(self):
obj = self._build_obj("regs_int_params.o")
@@ -53,8 +52,6 @@ def test_regs_int_params(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
- @skipIfWindows
- @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_fp_params(self):
obj = self._build_obj("regs_fp_params.o")
@@ -70,8 +67,6 @@ def test_regs_fp_params(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
- @skipIfWindows
- @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_regs_mixed_params(self):
obj = self._build_obj("regs_mixed_params.o")
@@ -87,8 +82,6 @@ def test_regs_mixed_params(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
- @skipIfWindows
- @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_live_across_call(self):
obj = self._build_obj("live_across_call.o")
@@ -101,8 +94,6 @@ def test_live_across_call(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
- @skipIfWindows
- @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_loop_reg_rotate(self):
obj = self._build_obj("loop_reg_rotate.o")
@@ -117,8 +108,6 @@ def test_loop_reg_rotate(self):
self.assertNotIn("<decoding error>", out)
@no_debug_info_test
- @skipIfWindows
- @skipUnlessPlatform(["linux", "freebsd", "netbsd"])
@skipIf(archs=no_match(["x86_64"]))
def test_seed_reg_const_undef(self):
obj = self._build_obj("seed_reg_const_undef.o")
More information about the lldb-commits
mailing list