microsoft / microsoft/vscode-cpptools

macos: very long wait time until applicationDidFinishLaunching is reached in VSCode but not XCode

Aperta
#13,193 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug debugger help wanted
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Environment
  • OS and version: macOS 15.2
  • VS Code: 1.96.4
  • C/C++ extension: 1.22.11
  • GDB / LLDB version: system lldb is lldb-1600.0.39.109
Bug Summary and Steps to Reproduce

Bug Summary:

NOTE: This is not a new problem, but it seems to get worse with each new macOS version :/

When debugging a Cocoa application in VSCode with the C/C++ extension, it takes 10 seconds or so in each debug session until the applicationDidFinishLaunching callback is reached. Most of that time is spent between [NSApp run] and applicationDidFinishLaunching. This long wait time is the same between the first and followup debug sessions.

In Xcode, only the first debug session after starting Xcode shows a similar slow behaviour, while the following debug sessions start much faster (not quite instantly, but fast enough to not be an issue).

It would be good to at least investigate why there is this difference between VScode and XCode.

Steps to reproduce:

  1. In Xcode, create the 'Game' builtin project, build and do some debugging. Note how everything is reasonably fast, especially in the followup debug sessions.
  2. Create a launch.json in VSCode pointing to the same executable (which is a bit tricky to find: in Xcode Product => Show Build Folder in Finder to find the executable.
  3. Debug the same executable in VSCode and note how very long it takes until window appears

...in VSCode, there's a metric shitton of log output on the debug console during that waiting time, all about loading symbols from system frameworks like this:

Loaded '/System/Library/PrivateFrameworks/CoreSDB.framework/Versions/A/CoreSDB'. Symbols loaded.

...maybe this symbol loading is the main reason for the long waiting time, and this is somehow cached in XCode?

Personally I'm not interested in those symbols anyway, maybe there's an LLDB setting for this system framework symbol loading to be skipped, or delayed until they are actually needed?

Debugger Configurations
{
    "configurations": [
    {
        "name": "(lldb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "/Users/floh/Library/Developer/Xcode/DerivedData/test-game-bwcgwlktppxrepgyqrpwyczwdpqx/Build/Products/Debug/test-game.app/Contents/MacOS/test-game",
        "args": [],
        "stopAtEntry": true,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "lldb"
    }
    ]
}
Debugger Logs
Debug output log is too long attach, but it's about 1000 lines of lines like this:

Loaded '/System/Library/PrivateFrameworks/LinkServices.framework/Versions/A/LinkServices'. Symbols loaded.
Other Extensions

No response

Additional Information

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riprodurre il ritardo con il launch.json fornito utilizzando l’eseguibile Cocoa compilato da Xcode su macOS, quindi esaminare la console del debugger durante la pausa dopo [NSApp run]. Confrontare sessioni VS Code ripetute con sessioni Xcode ed esaminare i numerosi messaggi LLDB sul caricamento dei simboli per i framework di sistema. Il lavoro è completato quando è stato identificato il motivo per cui VS Code non replica il comportamento di avvio di Xcode e quando è stato documentato o implementato un modo supportato per evitare l’attesa non necessaria.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, macos, typescript
Ambito
desktop-dev, devtools, operating-systems
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.