[Lldb-commits] [lldb] [lldb][test] Add requireMinidumpSave test decorator (PR #233775)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 20 03:26:14 PDT 2026
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/233775
So we don't have to remember to add all the supported architectures to new tests.
You can confirm the supported architectures for
saving specifically by looking at
ArchThreadContexts::prepareRegisterContext.
Only x86_64 and AArch64 are handled.
(I think we can read for other architectures,
but I haven't confirmed that)
TestMinidumpReloadCrash.py also checked for "arm64" and "arm64e". So I've included those in the require as well. This might result in more tests running
where they didn't before.
>From 8c0b64fd70a80dd88f8aecf088d00b3e97f91af7 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Tue, 20 Oct 2026 10:16:33 +0000
Subject: [PATCH] [lldb][test] Add requireMinidumpSave test decorator
So we don't have to remember to add all the supported
architectures to new tests.
You can confirm the supported architectures for
saving specifically by looking at
ArchThreadContexts::prepareRegisterContext.
Only x86_64 and AArch64 are handled.
(I think we can read for other architectures,
but I haven't confirmed that)
TestMinidumpReloadCrash.py also checked for "arm64"
and "arm64e". So I've included those in the require
as well. This might result in more tests running
where they didn't before.
---
.../packages/Python/lldbsuite/test/decorators.py | 10 ++++++++++
.../TestProcessSaveCoreMinidump.py | 16 ++++++++--------
.../TestProcessSaveCoreMinidump64b.py | 4 ++--
.../TestMinidumpReloadCrash.py | 3 +--
.../TestMinidumpSizeOfImage.py | 2 +-
.../lldb-dap/save-core/TestDAP_save_core.py | 2 +-
6 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index 4cad3500b7d839..f2831c47f206fe 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1322,6 +1322,16 @@ def requireClang(func):
)(func)
+def requireMinidumpSave(func):
+ """Mark the item as requiring the ability to save a Minidump file. Which
+ is not implemented for all architectures."""
+ arch = lldbplatformutil.getArchitecture()
+ return unittest.skipUnless(
+ arch in ["aarch64", "x86_64", "arm64", "arm64e"],
+ UnsupportedReason(f"Minidump saving is not implemented for {arch}"),
+ )(func)
+
+
def skipIfTargetDoesNotSupportSharedLibraries():
"""Skip tests that require shared library (dylib/so) support."""
platform = lldbplatformutil.getPlatform()
diff --git a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
index 431e4db9e9b706..f5f7ebc64252e6 100644
--- a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
+++ b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
@@ -134,7 +134,7 @@ def verify_core_file(
self.dbg.DeleteTarget(target)
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
def test_save_linux_mini_dump(self):
"""Test that we can save a Linux mini dump."""
@@ -279,7 +279,7 @@ def test_save_linux_mini_dump(self):
if os.path.isfile(core_sb_full):
os.unlink(core_sb_full)
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
# We try to read Linux /proc files from the host not the remote:
# https://github.com/llvm/llvm-project/issues/231472
@@ -342,7 +342,7 @@ def test_save_linux_mini_dump_thread_options(self):
if os.path.isfile(thread_subset_dmp):
os.unlink(thread_subset_dmp)
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
def test_save_linux_mini_dump_default_options(self):
"""Test that we can save a Linux mini dump with default SBSaveCoreOptions"""
@@ -398,7 +398,7 @@ def test_save_linux_mini_dump_default_options(self):
if os.path.isfile(default_value_file):
os.unlink(default_value_file)
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
def test_save_linux_minidump_one_region(self):
"""Test that we can save a Linux mini dump with one region in sbsavecore regions"""
@@ -461,7 +461,7 @@ def test_save_linux_minidump_one_region(self):
if os.path.isfile(one_region_file):
os.unlink(one_region_file)
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
def test_save_minidump_custom_save_style(self):
"""Test that verifies a custom and unspecified save style fails for
@@ -531,7 +531,7 @@ def save_core_with_region(self, process, region_index):
if os.path.isfile(custom_file):
os.unlink(custom_file)
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
def test_save_minidump_custom_save_style_duplicated_regions(self):
"""Test that verifies a custom and unspecified save style fails for
@@ -668,7 +668,7 @@ def minidump_deterministic_difference(self):
self.assertTrue(self.dbg.DeleteTarget(target))
@skipUnlessPlatform(["linux"])
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
# We find the variable but its value is 0.
@expectedFailureAll(archs=["x86_64", "aarch64"])
def test_minidump_saves_tls(self):
@@ -700,7 +700,7 @@ def test_minidump_saves_tls(self):
if os.path.isfile(tls_file):
os.unlink(tls_file)
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
def test_invalid_custom_regions_not_included(self):
options = lldb.SBSaveCoreOptions()
diff --git a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump64b.py b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump64b.py
index b59fd0391cb05f..7d01e9f2114456 100644
--- a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump64b.py
+++ b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump64b.py
@@ -72,7 +72,7 @@ def verify_minidump(
if core_target is not None:
self.assertTrue(self.dbg.DeleteTarget(core_target))
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
def test_minidump_save_style_full(self):
"""Test that a full minidump is the same byte for byte."""
@@ -87,7 +87,7 @@ def test_minidump_save_style_full(self):
if os.path.isfile(minidump_path):
os.unlink(minidump_path)
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
def test_minidump_save_style_mixed_memory(self):
"""Test that a mixed memory minidump is the same byte for byte."""
diff --git a/lldb/test/API/functionalities/process_save_core_minidump_reload_crash/TestMinidumpReloadCrash.py b/lldb/test/API/functionalities/process_save_core_minidump_reload_crash/TestMinidumpReloadCrash.py
index 4f5e191186637b..5b2344ee559a31 100644
--- a/lldb/test/API/functionalities/process_save_core_minidump_reload_crash/TestMinidumpReloadCrash.py
+++ b/lldb/test/API/functionalities/process_save_core_minidump_reload_crash/TestMinidumpReloadCrash.py
@@ -9,8 +9,7 @@
class MinidumpReloadCrashTestCase(TestBase):
- # The minidump writer only emits a thread context for x86_64 and arm64.
- @skipIf(archs=no_match(["x86_64", "arm64", "arm64e", "aarch64"]))
+ @requireMinidumpSave
def test_reload_minidump_does_not_crash(self):
self.build()
target, process, thread, bkpt = lldbutil.run_to_name_breakpoint(self, "main")
diff --git a/lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py b/lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py
index d3074bef21633c..1abbbbe04e55c1 100644
--- a/lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py
+++ b/lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py
@@ -118,7 +118,7 @@ def get_expected_size(self, target, module):
return total
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@skipUnlessPlatform(["linux"])
# Building the shared library assumes we will run on the host.
@skipIfRemote
diff --git a/lldb/test/API/tools/lldb-dap/save-core/TestDAP_save_core.py b/lldb/test/API/tools/lldb-dap/save-core/TestDAP_save_core.py
index 556b358b192fd8..90be15306ec92e 100644
--- a/lldb/test/API/tools/lldb-dap/save-core/TestDAP_save_core.py
+++ b/lldb/test/API/tools/lldb-dap/save-core/TestDAP_save_core.py
@@ -13,7 +13,7 @@
class TestDAP_save_core(DAPTestCaseBase):
SHARED_BUILD_TESTCASE = False
- @skipIf(archs=no_match(["x86_64", "aarch64"]))
+ @requireMinidumpSave
@requireLinux
def test_save_and_reload_core(self):
"""Save minidump cores in every supported `--style` from a single
More information about the lldb-commits
mailing list