[Lldb-commits] [lldb] [lldb][minudump][test] Fix save_core_with_region on Windows host (PR #231466)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 13 04:57:00 PDT 2026
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/231466
On Windows we cannot unlink a file that lldb still has open. Which it does in this case because the minidump target is not deleted first. Delete the target, then try to remove the file.
These tests would not normally run on Windows but they do when remote debugging Linux from Windows as this bot does https://lab.llvm.org/buildbot/#/builders/197/builds/19949.
Follow up to #231448.
>From 8a7e94c6181ef56cfae36bbab260eb74bf2d3d19 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Tue, 13 Oct 2026 11:52:48 +0000
Subject: [PATCH] [lldb][minudump][test] Fix save_core_with_region on Windows
host
On Windows we cannot unlink a file that lldb still has a handle
to. Which it did in this case because the minidump target was not
deleted first. Delete the target, then try to remove the file.
Follow up to #231448.
---
.../TestProcessSaveCoreMinidump.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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 772b5cced05a1..f3a179b93addb 100644
--- a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
+++ b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
@@ -481,8 +481,9 @@ def test_save_minidump_custom_save_style(self):
os.unlink(custom_file)
def save_core_with_region(self, process, region_index):
+ core_target = None
+ custom_file = self.getBuildArtifact("core.custom.dmp")
try:
- custom_file = self.getBuildArtifact("core.custom.dmp")
memory_region = lldb.SBMemoryRegionInfo()
memory_list = process.GetMemoryRegions()
memory_list.GetMemoryRegionAtIndex(0, memory_region)
@@ -512,6 +513,8 @@ def save_core_with_region(self, process, region_index):
)
range_set.add(mem_tuple)
finally:
+ if core_target:
+ self.assertTrue(self.dbg.DeleteTarget(core_target))
if os.path.isfile(custom_file):
os.unlink(custom_file)
More information about the lldb-commits
mailing list