This is an archive of the discontinued LLVM Phabricator instance.

[lldb][PlatformDarwin] Only parse SDK from debug-info if target language is Objective-C
AcceptedPublic

Authored by Michael137 on Aug 9 2023, 7:48 AM.

Details

Reviewers
aprantl
Summary

The call to HostInfoMacOSX::GetSDKRoot can noticeably slow down the first
expression evaluation in an LLDB session. For C++ expressions we don't
actually ever use the results of the ClangDeclVendor, so getting the
flags right isn't necessary. Thus skip SDK parsing logic for C++
targets.

An alternative would be to entirely omit the setup of the
ClangDeclVendor (and other Objective-C machinery) for C++ targets.

Diff Detail

Event Timeline

Michael137 created this revision.Aug 9 2023, 7:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 7:48 AM
Herald added a subscriber: kadircet. · View Herald Transcript
Michael137 requested review of this revision.Aug 9 2023, 7:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 7:48 AM

It's fairly common for AppKit developers to use access to static methods under NSApplication to see the state of the application. Since you aren't actually accessing the frame variables for this purpose, it's also pretty common for those folks to do:

(lldb) process interrupt
(lldb) p [{NSApplication sharedApplication] someRequest]

That works today w/o having to specify a language. It would be good if this change didn't break that...

aprantl accepted this revision.Aug 14 2023, 9:52 AM

Apart from Jim's comment (does this still work?) this seems like a reasonable heuristic.

This revision is now accepted and ready to land.Aug 14 2023, 9:52 AM