Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to specify visualizerFile (and other launch configuration options) in debug config #453

Closed
1 task done
twhittock-disguise opened this issue Nov 20, 2024 · 7 comments

Comments

@twhittock-disguise
Copy link

Checklist

Is your feature request related to a problem? Please describe.
When debugging my tests, it is frustrating that I am unable to use C++ natvis visualisation files. This is because they are added to my launch configurations in the visualizerFile section.

I am unable to use my launch configurations as it's unclear if/how the executable name and arguments are passed to the configuration.

Describe the solution you'd like
I'd like to either be able to use a generic launch configuration with this extension filling in the appropriate executable and command line arguments, or be able to specify all the launch configuration options in the debug.configTemplate section.

Describe alternatives you've considered
There is a workaround - copy the .natvis files from my project into ~/.vscode(-insiders)/extensions/ms-vscode.cpptools-x.y.z/debugAdapters/vsdbg/bin/Visualizers but this will frequently break due to the cpptools extension being updated.

Additional context
None

@matepek
Copy link
Owner

matepek commented Nov 26, 2024

Hello,

Did you find this doc?

@twhittock-disguise
Copy link
Author

twhittock-disguise commented Nov 26, 2024

Hi yes I read the documentation - I didn't see anything around specific launch config options though? Did I miss it?

@matepek
Copy link
Owner

matepek commented Nov 26, 2024

At first read, I think the usable variables section answers your question. If not, please elaborate on your issue.

@twhittock-disguise
Copy link
Author

twhittock-disguise commented Nov 26, 2024

Hi.

Sorry I don't understand how parameterising the debug config can make it use options from launch.json.

Here's an example launch.json config object

        {
            "name": "myprog",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/${command:cpptools.activeConfigName}/myprog.exe",
            "visualizerFile": ".vscode/visualiser.natvis",
            "preLaunchTask": "build",
        },

Elements like preLaunchTask and visualizerFile aren't available in the debug config object, that I can see.

@matepek
Copy link
Owner

matepek commented Nov 27, 2024

This extension does not do any debugging, it uses the debug adapters/extensions.

Don't depend on launch config. Try setting your testMate.cpp.debug.configTemplate. All the mentioned variables are available there.

@twhittock-disguise
Copy link
Author

Yes, debugging works fine using the debug.configTemplate configuration. This issue was raied due to the lack of several things which are present when debugging using a launch command instead.

Specifically, the visualizerFile option is not applied when debugging tests. Also things like the preLaunchTask are helpful checks to ensure I am always debugging the latest code. There are a few of these, those are the ones I use, especially the visualizerFile, as some of my types are a pain to debug without it.

@matepek
Copy link
Owner

matepek commented Dec 18, 2024

preLaunchTask not run I'm not sure it is the issue of this extension because this extension just passes whatever debug config it gets. That applies to other json properties.

check log message 'debug config data' and 'resolved debugConfig:'.

preLaunchTask probably can be circumvented with advancedExecutable before property.

@matepek matepek closed this as completed Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants