This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Read from the Rosetta shared cache with Xcode 14
ClosedPublic

Authored by JDevlieghere on Jul 25 2022, 8:26 PM.

Details

Summary

Xcode 14 no longer puts the Rosetta expanded shared cache under 16.0. Instead, it includes the real version number (e.g. 13.0), the build string and the architecture, similar to the device support directory names for iOS, tvOS and watchOS.

Currently, when there are multiple directories, we end up picking the wrong one in GetSDKDirectoryForCurrentOSVersion. The problem is that without the build string we have no way to differentiate between directories with the same version number.

13.0 (22A111) x86_64/
13.0 (22A222) x86_64/
13.0 (22A333) x86_64/

This patch fixes the problem by using GetOSBuildString which, as the name implies, returns the build string if it's known. For the host platform this returns the host build string while for a remote platform this returns the remote build string.

I added a Rosetta test and verified that this doesn't break remote ios debugging.

rdar://97576121

Diff Detail

Event Timeline

JDevlieghere created this revision.Jul 25 2022, 8:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 8:26 PM
JDevlieghere requested review of this revision.Jul 25 2022, 8:26 PM
JDevlieghere edited the summary of this revision. (Show Details)
mib accepted this revision.Jul 26 2022, 10:07 AM

LGTM with a comment.

lldb/test/API/macosx/rosetta/TestRosetta.py
8–11

Why not add this to decorators.py ?

This revision is now accepted and ready to land.Jul 26 2022, 10:07 AM
aprantl added inline comments.Jul 26 2022, 10:48 AM
lldb/test/API/macosx/rosetta/TestRosetta.py
8–11

FWIW, there's a skipIfRosetta decorator there already.

JDevlieghere marked an inline comment as done.Jul 26 2022, 1:08 PM
JDevlieghere added subscribers: adrian, ismail.
JDevlieghere added inline comments.
lldb/test/API/macosx/rosetta/TestRosetta.py
8–11

@adrian: That's not the same thing, that's when the test suite as a whole is run under rosetta.
@ismail: I thought it was too specific and only used for one test, but I think it makes sense to move it there.

This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2022, 3:27 PM