This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add a function to check if lldb is running in an interactive session
ClosedPublic

Authored by JDevlieghere on May 3 2022, 1:22 PM.

Details

Summary

This patch adds a function to check if lldb is running in an interactive debug session. Currently this API only works on macOS. It's expected to be used in combination with Host::OpenFileInExternalEditor.

Diff Detail

Event Timeline

JDevlieghere created this revision.May 3 2022, 1:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 1:22 PM
JDevlieghere requested review of this revision.May 3 2022, 1:22 PM
aprantl accepted this revision.May 3 2022, 1:33 PM

Thank you! This is equally useful and untestable :-)

This revision is now accepted and ready to land.May 3 2022, 1:33 PM
aprantl added inline comments.May 3 2022, 1:35 PM
lldb/source/Host/macosx/objcxx/Host.mm
411

Wait. I think this is a misnomer. An lldb session over SSH is interactive, but not graphical. Should this be called IsInteractiveDesktopSession/IsInteractiveGraphicSession/IsInteractiveGUISession?

aprantl requested changes to this revision.May 3 2022, 1:35 PM
This revision now requires changes to proceed.May 3 2022, 1:35 PM

IsInteractiveSession -> IsInteractiveGraphicSession

aprantl accepted this revision.May 3 2022, 1:54 PM

One last request: Could you add a Doxygen comment?

This revision is now accepted and ready to land.May 3 2022, 1:54 PM
mib added a subscriber: mib.May 3 2022, 2:21 PM
mib added inline comments.
lldb/source/Host/macosx/objcxx/Host.mm
411

FWIW, if you open a file on macOS over SSH, it would still open it in the default app. I'd expect the same behaviour here.

mib added inline comments.May 3 2022, 2:22 PM
lldb/source/Host/macosx/objcxx/Host.mm
411

FWIW, if you open a file on macOS over SSH, it would still open it in the default app. I'd expect the same behaviour here.

... Even if you're not in front of the screen.

aprantl added inline comments.May 3 2022, 3:08 PM
lldb/source/Host/macosx/objcxx/Host.mm
411

Right, that's why we don't want to open files in the external editor if we are connected over SSH.

Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 3:12 PM