[Lldb-commits] [lldb] 693146d - [lldb][yaml2macho-core] Address bug when run on Windows

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 8 10:38:02 PDT 2025


Author: Jason Molenda
Date: 2025-09-08T10:37:16-07:00
New Revision: 693146dcc0a1d653827cc88993acf52428af1a94

URL: https://github.com/llvm/llvm-project/commit/693146dcc0a1d653827cc88993acf52428af1a94
DIFF: https://github.com/llvm/llvm-project/commit/693146dcc0a1d653827cc88993acf52428af1a94.diff

LOG: [lldb][yaml2macho-core] Address bug when run on Windows

The two API tests I converted to use yaml2macho-core were failing
on windows.  I was writing the output corefile with fopen(filename,
"w"), and it turns out there was some newline conversion happening
on Windows if a linefeed character was present. Charles Zablit
helped to identify the issue and confirm the fix.  Re-enabling the
two tests on all platforms.

https://github.com/llvm/llvm-project/pull/153911

Added: 
    

Modified: 
    lldb/test/API/macosx/arm-corefile-regctx/TestArmMachoCorefileRegctx.py
    lldb/test/API/macosx/riscv32-corefile/TestRV32MachOCorefile.py
    lldb/tools/yaml2macho-core/yaml2macho.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/macosx/arm-corefile-regctx/TestArmMachoCorefileRegctx.py b/lldb/test/API/macosx/arm-corefile-regctx/TestArmMachoCorefileRegctx.py
index acb6956ec478b..a2890cdfeaa44 100644
--- a/lldb/test/API/macosx/arm-corefile-regctx/TestArmMachoCorefileRegctx.py
+++ b/lldb/test/API/macosx/arm-corefile-regctx/TestArmMachoCorefileRegctx.py
@@ -13,7 +13,6 @@
 class TestArmMachoCorefileRegctx(TestBase):
     NO_DEBUG_INFO_TESTCASE = True
 
-    @skipUnlessDarwin # CI fail on Windows, lr has value 0x0F000000?
     def test_armv7_corefile(self):
         ### Create corefile
         corefile = self.getBuildArtifact("core")

diff  --git a/lldb/test/API/macosx/riscv32-corefile/TestRV32MachOCorefile.py b/lldb/test/API/macosx/riscv32-corefile/TestRV32MachOCorefile.py
index f791c01313fb1..449da70fb08ca 100644
--- a/lldb/test/API/macosx/riscv32-corefile/TestRV32MachOCorefile.py
+++ b/lldb/test/API/macosx/riscv32-corefile/TestRV32MachOCorefile.py
@@ -13,7 +13,6 @@
 class TestRV32MachOCorefile(TestBase):
     NO_DEBUG_INFO_TESTCASE = True
 
-    @skipUnlessDarwin  # windows CI failure, says only 1 thread in corefile
     @no_debug_info_test
     def test_riscv32_gpr_corefile_registers(self):
         corefile = self.getBuildArtifact("core")

diff  --git a/lldb/tools/yaml2macho-core/yaml2macho.cpp b/lldb/tools/yaml2macho-core/yaml2macho.cpp
index b01f61d491079..85979a37d1676 100644
--- a/lldb/tools/yaml2macho-core/yaml2macho.cpp
+++ b/lldb/tools/yaml2macho-core/yaml2macho.cpp
@@ -198,7 +198,7 @@ int main(int argc, char **argv) {
   if (lc_note_payload_bytes.size() > 0)
     payload_fileoff = (payload_fileoff + 4096 - 1) & ~(4096 - 1);
 
-  FILE *f = fopen(OutputFilename.c_str(), "w");
+  FILE *f = fopen(OutputFilename.c_str(), "wb");
   if (f == nullptr) {
     fprintf(stderr, "Unable to open file %s for writing\n",
             OutputFilename.c_str());


        


More information about the lldb-commits mailing list