Debugging with LLVM-based executables that are NOT C++ syntax with .swift file extension
When I change a .swift file to highlight as a C++ file (via lower toolbar in VSCode) I can set breakpoints but I lose swift syntax highlighting. Without doing that, I cannot set breakpoints. Is there any way to decouple syntax highlighting and what cpp sees as files that can have breakpoints? Debugging swift with cpptools seems to work perfectly fine, it just seems a shame that I have to lose all syntax highlighting to do so.
This sounds more like an issue for whatever repository does your swift syntax highlighting, not so much this repo's.
After a bit of searching, I found and inserted "swift" into this array found here (repo/Extension/package.json): https://github.com/Microsoft/vscode-cpptools/blob/a096ec9c6f10cda042fc23561096dd5c099890f5/Extension/package.json#L519-L528
As a result, breakpoints are enabled and debugging works normally! There are also some separate (if lang == "cpp" || lang == "c") in about 6 places in the code which control for non-debugging functionality of the plugin, but the filtration does not seem to have a negative effect so far. It would seem a reasonable request that this array be a configurable one.
I'm not entirely sure how package.json's work (this is my first time digging into an extension source), but is it possible at all to override that as a user?
@krworks if you change the package.json, it will get overwritten every time there is an update.
Would like to chime in here that i have conceptually the same issue. I was just about to make my own issue on this, actually.
I'm using GDB to debug my C++, and my project also has assembly files compiled with GDB debug information. The ability to set breakpoints in my asm files would be helpful.
The same workaround of changing the file association to C/C++ also allows debugging and breakpoints to work normally, but is of course undesirable.(I would never have even thought to do that until just now..)
One possible solution is to expose an extension setting that lists additional languages that should be recognized as debuggable.
This actually can be solved with the debug.allowBreakpointsEverywhere setting, apparently added in Microsoft/vscode#13507
Closing this issue due to long inactivity and resolved according to the last comment.