Vscode-cpptools: Allow breakpoints in other native languages source files

Created on 17 Jun 2016  路  6Comments  路  Source: microsoft/vscode-cpptools

C/C++ plugin integrates native debugging. I'm working on a mixed C++ and D project, but the IDE won't let me place breakpoints in .d files. I can step into those languages as you expect from GDB.
I suspect this may also be a problem for other native languages (rust, obj-c, etc?).

Feature Request debugger

Most helpful comment

You can circumvent this with the following:
Got to File -> Preferences -> Settings -> Debug ->debug.allowBreakpointsEverywhere = true

Also #440 is a duplicate of this.

All 6 comments

I have the same problem with Fortran files (.f, .F90).

I just wanna ask if there's any movement on this? It's really holding up my work, and it seems like it should be a trivial fix?

VSCode debugger extensions have to declare what files they allow breakpoints to be set in. This exists in the package.json file for the extension. If you add file extensions for the languages you care about in this section of ~/.vscode/extensions/ms-vscode.cpptools-0.9.2/package.json:
"debuggers": [
{
"type": "cppdbg",
"label": "C++ (GDB/LLDB)",
"enableBreakpointsFor": {
"languageIds": [
"cpp",
"c",
".h",
".cc",
".cxx",
".hpp",
".hh",
".hxx"
]
},

Do things work better? Note that your milage may vary here, because you mentioned, we really only test with C/C++ with this extension.

I've added .F90, but still wasn't able to add breakpoints in .F90 files. I've disabled, reloaded, enabled, reloaded the C/C++ extension. Do I need to do anything else for these changes to take effect?

package.json is not the correct location for this. Have you tried manually adding an association to files.associations in your settings.json file? (File -> Preferences -> Settings)

{
  "files.associations": {
    "*.F90": "cpp",
    "*.d": "cpp"
  }
}

We can't override the default file set that maps to "c" and "cpp" languageIds in our extension, so if these extensions are already mapped by VSCode, it might not work. VSCode owns the mapping of file extensions to languageIds.

You can circumvent this with the following:
Got to File -> Preferences -> Settings -> Debug ->debug.allowBreakpointsEverywhere = true

Also #440 is a duplicate of this.

Was this page helpful?
0 / 5 - 0 ratings