penagos / vgdb

Visual Studio Code GDB Debug Adapter for C and C++ programs.
MIT License
11 stars 3 forks source link

Use Same Settings Names and Formats as vscode-cpptools #15

Open AE1020 opened 3 years ago

AE1020 commented 3 years ago

I'm attempting to debug vgdb by comparing back and forth with cpptools. This would be easier (and easier adoption in general) if the settings and formats used in launch.json were the same.

(Any improvement that a change like calling the debugger path "debugger" vs. "miDebuggerPath" is far outweighed by having it be different!)

For reference, here's their launch.json documentation:

https://code.visualstudio.com/docs/cpp/launch-json-reference

penagos commented 3 years ago

I had thought about this initially, though some of the interface the cpptools extension defines is somewhat clunky. Namely, when it comes to detining environment variables. In the official Microsoft debugging extension, you need to do something like:

 "environment": [{ "name": "config", "value": "Debug" }]

Whereas in vGDB, it suffices to do:

"env": {"config": "Debug"}

Which seemed a bit more natural to me.

AE1020 commented 3 years ago

I had thought about this initially, though some of the interface the cpptools extension defines is somewhat clunky.

Perhaps, though if you think of something you wanted to add on (like a tag for what configurations should define that variable or not) it could be argued that the approach is prepared for it.

Beyond having support for two different variable names (environment vs. env or envVGDB) and two different styles, another approach might be to allow strings in the array as an alternative to objects:

"environment": ["MY_PATH=/home/me", { "name": "config", "value": "Debug" }]

This way a file that came in with cpptools conventions would work on day one. The same approach could be used with the startup commands. And maybe cpptools would add support for it too. If you think of other attributes you might want to tack onto an environment entry you have a syntax for that lined up.

In any case: my own feeling would be that those who are trying to work with debuggers aren't hyper-concerned about the amount of boilerplate in the config file. You don't edit it that often, and the time spent editing it pales in comparison to the hours upon hours of banging your head against why symbols won't load/etc. Being able to flip back and forth between vgdb and cpptools is the stronger evolutionary path.