This is an archive of the discontinued LLVM Phabricator instance.

PlatformDarwinKernel::GetSupportedArchitectures should report all supported architectures
ClosedPublic

Authored by jasonmolenda on Nov 2 2022, 4:31 PM.

Details

Summary

PlatformDarwinKernel had an old idiom in its GetSupportedArchitectures method, which would turn the list of supported architectures based on the compile-time debug host. This doesn't make any sense; you can debug an arm kernel from an x86 mac, but it usually didn't cause any obvious problems so it went unnoticed. Fix that.

Also some NFC changes to Target::SetArchitecture log messages, to make it easier to track the Target's architecture as it is refined/updated.

Diff Detail

Event Timeline

jasonmolenda created this revision.Nov 2 2022, 4:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2022, 4:31 PM
jasonmolenda requested review of this revision.Nov 2 2022, 4:31 PM

I should note that PlatformDarwin::ARMGetSupportedArchitectures and PlatformDarwin::x86GetSupportedArchitectures append the entries to the vector passed in, so calling them in sequence is fine.

LGTM

lldb/source/Target/Target.cpp
1550–1556

If you use LLDB_LOG you could drop the .c_str()

JDevlieghere accepted this revision.Nov 2 2022, 5:22 PM
This revision is now accepted and ready to land.Nov 2 2022, 5:22 PM