Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix iOS simulator tests with lldb 13 #149

Merged
merged 1 commit into from
Mar 17, 2022
Merged

Conversation

simlay
Copy link
Contributor

@simlay simlay commented Mar 17, 2022

I went to write some iOS unit tests today and found that the output for lldb -s <script> has removed blank lines in the output.

It used to be something like:

(lldb) command source -s 0 '../lldb-script'
Executing commands in '/Users/simlay/projects/rust-ios/dinghy/lldb-script'.
(lldb) attach 9325
Process 9325 stopped
* thread #1, stop reason = signal SIGSTOP
    frame #0: 0x0000000202f4a455 dyld`invocation function for block in dyld3::MachOFile::forEachSegment(void (dyld3::MachOFile::SegmentInfo const&, bool&) block_pointer) const + 549
dyld`invocation function for block in dyld3::MachOFile::forEachSegment(void (dyld3::MachOFile::SegmentInfo const&, bool&) block_pointer) const:
->  0x202f4a455 <+549>: callq  *0x10(%rdi)
    0x202f4a458 <+552>: movq   0x28(%r14), %rax
    0x202f4a45c <+556>: movq   0x8(%rax), %rax
    0x202f4a460 <+560>: incl   0x18(%rax)
Target 0: (Dinghy) stopped.

Executable module set to "/Users/simlay/Library/Developer/CoreSimulator/Devices/2E203D7E-6774-4160-ACEC-AC553A01B697/data/Containers/Bundle/Application/F50E1504-ECCD-45B4-A507-04BEE1E016E2/Dinghy.app/Dinghy".
Architecture set to: x86_64-apple-ios-simulator.
(lldb) continue
Process 9325 resuming
Process 9325 exited with status = 101 (0x00000065)

(lldb) quit

And now the ending portion which has the exited with status it is something like:

(lldb) continue
Process 9325 resuming
Process 9325 exited with status = 101 (0x00000065)
(lldb) quit

I checked the llvm 13 release notes (because xcode 13 ships with llvm 13 I think) and couldn't find anything about this. Probably because changes to the stdout of a lldb script aren't meant for programmatic use. Long term I think using something like the lldb crate.

Anyway, I changed this to work with both outputs by removing blank lines.

@simlay simlay changed the title Added more logic to remove empty lines in lldb output Fix iOS simulator tests with lldb 13 Mar 17, 2022
@kali
Copy link
Collaborator

kali commented Mar 17, 2022

Thanks!

@kali kali merged commit 706c5a0 into sonos:main Mar 17, 2022
@kali
Copy link
Collaborator

kali commented Mar 17, 2022

Pushing a release too.

@simlay simlay deleted the fix-for-newer-lldb branch July 1, 2022 18:44
@simlay simlay mentioned this pull request Jul 1, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants