Vscode-cpptools: Very SLOW to start up GDB debugging session

Created on 17 Feb 2018  Â·  8Comments  Â·  Source: microsoft/vscode-cpptools

I use VSCode on linux to debug c++ programs. I have the latest stable version of both vscode and cpptools. I've noticed that, after starting vscode or reloading it, when i press F5 to attach gdb to a running program, it takes several minutes for the "pid selection" drop down to show up. This appears to only when launching a debugging session for the very first time after starting or reloading vscode. Subsequent debugging sessions start up immediately after F5 pressed.

debugger more info needed

All 8 comments

@huili80 is this local or remote debugging? which OS are you doing this on?

Linux, local. The executable is fairly big though, ~1GB in size, not sure if this may have something to do with the slowness.

@huili80 the code is here and it is calling into this ps call to get the list of processes and filtering it out. I don't know why it would be slow for it on the first time though, unless its loading the dependency libraries for the first time.

I found something interesting. Immediately after opening up a project or reloading the window, if i press F5 to launch a debugging session, i see an error complaining that renderer1 couldn't find the launch.json file, even thought the file definitely exits. The following is from renderer1's log (with actual paths replaced with ${...})

[2018-02-20 21:17:49.688] [renderer1] [error] File not found (file://${home}/.config/Code/logs/20180220T211233/extHost1.log): Error: File not found (file://${home}/.config/Code/logs/20180220T211233/extHost1.log)
    at new t (file://${vscode-root}/resources/app/out/vs/workbench/workbench.main.js:1258:989)
    at file://${vscode-root}/resources/app/out/vs/workbench/workbench.main.js:2785:867
    at Object.v [as _notify] (file://${vscode-root}/resources/app/out/vs/workbench/workbench.main.js:141:427)
    at Object.enter (file://${vscode-root}/resources/app/out/vs/workbench/workbench.main.js:144:660)
    at n.Class.derive._oncancel._run (file://${vscode-root}/resources/app/out/vs/workbench/workbench.main.js:145:970)
    at n.Class.derive._oncancel._error (file://${vscode-root}/resources/app/out/vs/workbench/workbench.main.js:145:487)
    at file://${vscode-root}/resources/app/out/vs/workbench/workbench.main.js:186:173
    at ${vscode-root}/resources/app/node_modules/graceful-fs/polyfills.js:284:29
    at FSReqWrap.oncomplete (original-fs.js:114:15)
[2018-02-20 21:19:08.012] [renderer1] [error] ${project-root}/.vscode/launch.json - no such file(s).

That seems to be an issue in VSCode but are you sure that this is causing the problem? You may want to try and file an issue there to see if this can cause latency.

I'm not sure whether it's the cause or not. I'll try file an issue with vscode. Thanks.

Linux, local. The executable is fairly big though, ~1GB in size, not sure if this may have something to do with the slowness.

GDB is known to launch slowly in such cases. It have very inoptimal symbols loading...

Hi, I have a similar problem. I just installed vscode on linux and tried both lldb and gdb. It is incredibly slow with both to start. my debugging session. When I use gdb/lldb without vscode it is incredibly fast. How can I debug this? I looked at the log under ~/.config/code/logs but didn't find anything useful.

Was this page helpful?
0 / 5 - 0 ratings