Skip to content

Conversation

@UltimateForce21
Copy link
Contributor

@UltimateForce21 UltimateForce21 commented Aug 29, 2025

The TestVariableAnnotationsDisassembler.py test assembles d_original_example.s,
which contains ELF-specific directives such as:

  • .ident
  • .section ".note.GNU-stack", "", @progbits
  • .section .debug_line, "", @progbits

These directives are not understood by COFF on Windows, so the test fails
on the lldb-remote-linux-win builder even when running on x86_64.

This patch adds a decorator to gate the test,

  • @skipUnlessPlatform(["linux", "freebsd", "netbsd", "android"])
    runs only on ELF platforms

Follow-up to #155942.

…(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).
@llvmbot
Copy link
Member

llvmbot commented Aug 29, 2025

@llvm/pr-subscribers-lldb

Author: Abdullah Mohammad Amin (UltimateForce21)

Changes

The TestVariableAnnotationsDisassembler.py test assembles d_original_example.s,
which contains ELF-specific directives such as:

  • .ident
  • .section ".note.GNU-stack", "", @<!-- -->progbits
  • .section .debug_line, "", @<!-- -->progbits

These directives are not understood by COFF on Windows, so the test fails
on the lldb-remote-linux-win builder even when running on x86_64.

This patch adds decorators to gate the test,

  • @<!-- -->skipIfWindows — skips on Windows/COFF
  • @<!-- -->skipUnlessPlatform(["linux", "freebsd", "netbsd", "android"])
    runs only on ELF platforms

Follow-up to #155942.


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

1 Files Affected:

  • (modified) lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py (+14)
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")

@github-actions
Copy link

github-actions bot commented Aug 29, 2025

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

Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

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

You might be able to apply the skip to the class, instead of repeating it for each function. Can you try that?

One test for example does this:

# Windows does not allow quotes in file names.
@skipIf(hostoslist=["windows"])
@skipIfRemote
class TestGdbRemoteLibrariesSvr4Support(gdbremote_testcase.GdbRemoteTestCaseBase):
    FEATURE_NAME = "qXfer:libraries-svr4:read"

Certain decorators might not work in that position though, so give it a go.

@DavidSpickett
Copy link
Collaborator

Also add a comment to either the first skip, or the one skip (whichever you end up doing), saying that the test requires ELF directives. Saves someone a trip to git blame later.

This change moves the platform skip logic to the test class instead of
repeating it for each method.
Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

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

LGTM!

@UltimateForce21
Copy link
Contributor Author

Thank you for the suggestions and I have done as you have advised.

@DavidSpickett DavidSpickett enabled auto-merge (squash) August 29, 2025 15:21
@DavidSpickett DavidSpickett disabled auto-merge August 29, 2025 15:22
@DavidSpickett DavidSpickett merged commit 599d353 into llvm:main Aug 29, 2025
8 of 9 checks passed
@DavidSpickett
Copy link
Collaborator

Edited the PR description slightly before merging, to reflect the single decorator.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 29, 2025

LLVM Buildbot has detected a new failure on builder cross-project-tests-sie-ubuntu-dwarf5 running on doug-worker-1b while building lldb at step 6 "test-build-unified-tree-check-cross-project".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/163/builds/25623

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-cross-project) failure: test (failure)
******************** TEST 'cross-project-tests :: debuginfo-tests/dexter-tests/memvars/inlining.c' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
inlining.c: nan/nan (nan) [Command '['/usr/bin/python3.10', '/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/dex/../dexter.py', 'run-debugger-internal-', '/tmp/lit-tmp-7vdwqr16/dexter/tmpaa5kxhqu/tmp4govqh_c', '--working-directory=/tmp/lit-tmp-7vdwqr16/dexter/tmpaa5kxhqu', '--unittest=off', '--indent-timer-level=3']' returned non-zero exit status 1.]


--
Command Output (stderr):
--
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/bin/clang -std=gnu11 -O2 -glldb /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c -o /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/projects/cross-project-tests/debuginfo-tests/dexter-tests/memvars/Output/inlining.c.tmp # RUN: at line 3
+ /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/bin/clang -std=gnu11 -O2 -glldb /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c -o /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/projects/cross-project-tests/debuginfo-tests/dexter-tests/memvars/Output/inlining.c.tmp
"/usr/bin/python3.10" "/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/dexter.py" test --fail-lt 1.0 -w --lldb-executable "/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/bin/lldb-dap" --debugger lldb-dap --binary /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/projects/cross-project-tests/debuginfo-tests/dexter-tests/memvars/Output/inlining.c.tmp -- /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c # RUN: at line 4
+ /usr/bin/python3.10 /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter/dexter.py test --fail-lt 1.0 -w --lldb-executable /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/bin/lldb-dap --debugger lldb-dap --binary /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/projects/cross-project-tests/debuginfo-tests/dexter-tests/memvars/Output/inlining.c.tmp -- /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c


****************************************


@DavidSpickett
Copy link
Collaborator

Btw, you have some leftover debug print() in the test cases. No rush but please do remove them at some point.

@DavidSpickett
Copy link
Collaborator

LLVM Buildbot has detected a new failure on builder cross-project-tests-sie-ubuntu-dwarf5

And this failure you can safely ignore :)

@UltimateForce21
Copy link
Contributor Author

UltimateForce21 commented Aug 29, 2025

Btw, you have some leftover debug print() in the test cases. No rush but please do remove them at some point.

Sounds good!

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.

4 participants