llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.28k stars 12.1k forks source link

remote debugging macOS to macOS launches app-bundle as "standalone executable" #107095

Open torarnv opened 2 months ago

torarnv commented 2 months ago

I've mounted the build directory of my host machine to a macOS VM, where I run (see #106854):

admin@macos1500beta7 ~ % export LLDB_DEBUGSERVER_PATH=/Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver
admin@macos1500beta7 ~ % /opt/homebrew/Cellar/llvm/18.1.8/bin/lldb-server platform --server --listen '*:1234' --log-channels "gdb-remote Process: lldb host"

I then connect to the VM and launch via:

platform select remote-macosx
platform connect connect://macos1500beta7:1234
target create /build/dir/path/to/my.app
run

Which launches the app.

But, the launched app does not show a menu bar, or have an entry in the Dock. And in Activity Monitor the process has the same icon as when running standalone executables.

Launching the app via lldb locally on the VM does not have this issue.

Adding an explicit activationPolicy = NSApplicationActivationPolicyRegular at startup "fixes" the dock and menu entries, but the icon is still missing.

I was under the impression that target create /build/dir/path/to/my.app would be reflected 1:1 to the remote machine, and launched there, but perhaps lldb is copying over /build/dir/path/to/my.app to the remote machine? And if so, is it missing the Info.plist?

Do I need to do something extra when launching remotely to ensure this works, or is it a bug?

torarnv commented 2 months ago

cc @JDevlieghere / @jasonmolenda