Skip to content

Commit 693146d

Browse files
committed
[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. #153911
1 parent 50b0c34 commit 693146d

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

lldb/test/API/macosx/arm-corefile-regctx/TestArmMachoCorefileRegctx.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
class TestArmMachoCorefileRegctx(TestBase):
1414
NO_DEBUG_INFO_TESTCASE = True
1515

16-
@skipUnlessDarwin # CI fail on Windows, lr has value 0x0F000000?
1716
def test_armv7_corefile(self):
1817
### Create corefile
1918
corefile = self.getBuildArtifact("core")

lldb/test/API/macosx/riscv32-corefile/TestRV32MachOCorefile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
class TestRV32MachOCorefile(TestBase):
1414
NO_DEBUG_INFO_TESTCASE = True
1515

16-
@skipUnlessDarwin # windows CI failure, says only 1 thread in corefile
1716
@no_debug_info_test
1817
def test_riscv32_gpr_corefile_registers(self):
1918
corefile = self.getBuildArtifact("core")

lldb/tools/yaml2macho-core/yaml2macho.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ int main(int argc, char **argv) {
198198
if (lc_note_payload_bytes.size() > 0)
199199
payload_fileoff = (payload_fileoff + 4096 - 1) & ~(4096 - 1);
200200

201-
FILE *f = fopen(OutputFilename.c_str(), "w");
201+
FILE *f = fopen(OutputFilename.c_str(), "wb");
202202
if (f == nullptr) {
203203
fprintf(stderr, "Unable to open file %s for writing\n",
204204
OutputFilename.c_str());

0 commit comments

Comments
 (0)