Repository navigation
cppdbg attach issues #5287
Description
Activity
Issue 1:
When attaching to a program using cppdbg with processId as ${command:pickProcess}, the command pick does not wait for the preLaunchTask initialization/finalization, processId command pick should start just after the preLaunchTask finalization.Unfortunately.
preLaunchTaskis handled by VSCode, they only guarantee that it will be completed before debug session starts.${command:pickProcess}runs when VS Code callsresolveDebugConfigurationwhich is done also before the debug session starts. You will want to file an issue on the VS Code issues page to have a way to have thepreLaunchTaskcomplete before sending it toresolveDebugConfiguration.Issue 2:
Not able to pass environment variables values to cppdbg when attaching to a program, but is possible when launching. Why? Let's say I have a PID stored inside an environment variable and I would like to use this variable for the attach processId property, how I would do that?The
environmentconfiguration in launch is to set thedebuggeeprocesses' environment variables before starting up the debuggee process. During attach, there is no way for us to inject the environment variables into the debuggee process before attaching to the process.Also setting up environment variables in
tasks.jsonwould require that VS Code uses the same terminal session for launching the debug adapter for the debugger to get the setup environment variables.gustavomassa commented
on Apr 13, 2020 AuthorMore actionsAndrew Wang (@WardenGnaw) I will open an issue on the vscode issues page. Regarding the issue 2, vscode should provide a way to read the processId, reading an environment variable/file or something else, like process name or pidof... I will make a point about it on the issue.
Reacted by Andrew WangVS Code has a way to provide custom inputs. I haven't tried this out myself, but this may possible with
commandinputs.However, this may require a change on the extension side to use
resolveDebugConfigurationWithSubstitutedVariablesgustavomassa commented
on Apr 14, 2020 AuthorMore actionsVS Code has a way to provide custom inputs. I haven't tried this out myself, but this may possible with
commandinputs.However, this may require a change on the extension side to use
resolveDebugConfigurationWithSubstitutedVariablesI could help you with the changes.
Superuser access is required to attach to a process. Attaching as superuser can potentially harm your computer. Do you want to continue? [y/N]
Also, an option to pass y/n to the superuser confirmation directly from the launch.json would be nice. Something like "allowSuperuser": true
Reacted by Claudio- addedfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.
on Oct 15, 2020 sean-mcmanus commented
on Nov 4, 2020 ContributorMore actionsReacted by Gustavo Massaneiro
Issue 1:
When attaching to a program using cppdbg with processId as ${command:pickProcess}, the command pick does not wait for the preLaunchTask initialization/finalization, processId command pick should start just after the preLaunchTask finalization.
Issue 2:
Not able to pass environment variables values to cppdbg when attaching to a program, but is possible when launching. Why? Let's say I have a PID stored inside an environment variable and I would like to use this variable for the attach processId property, how I would do that?
Launch/Tasks examples:
build/attach scripts: