Without a clear reproduction plan, it is very hard to tell why your breakpoints are not hitting.
But, one surest way of stopping on a line is writing:
debugger;
to the location where you want to stop. Without any blue signs on the gutter, the debugger will halt.
NOTE: Be sure to clear all the debugger; when you are done with it.
More info is here
Answer from Zafar on Stack OverflowWithout a clear reproduction plan, it is very hard to tell why your breakpoints are not hitting.
But, one surest way of stopping on a line is writing:
debugger;
to the location where you want to stop. Without any blue signs on the gutter, the debugger will halt.
NOTE: Be sure to clear all the debugger; when you are done with it.
More info is here
What I found worked was to set my breakpoints using the suggestions above, then in the extension's console run:
location.reload(true);
This re-opens the extensions, set off my breakpoints and allowed me to debug!
It appears that the problem is related to the debugger loading after the extension, thus not capturing the breakpoints. Hope that helps!
Debugger doesn't stop at breakpoints when running tests (but does during normal execution)
Debugger Doesn't Stop At Breakpoints
c# - Visual Studio Code debugger doesn't stop at breakpoints - Stack Overflow
VSCode Breakpoint not hitting/stopping when run in debugger mode - Golang
Videos
I use this configuration and work only if I insert this two line
// "stopOnEntry": true
// "justMyCode": false
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true,
"justMyCode": false
},
]
}
If you have upgraded your .Net Core SDK recently, just update netcoreappX.X
"program": "${workspaceFolder}/CommunityBot/bin/Debug/netcoreappX.X/CommunityBot.dll"
in launch.json file.
Check your .Net Core SDK version by dotnet --version
Setting "justMyCode": false makes it stop at breakpoint:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true,
"justMyCode": false
},
]
}
If you're using a pytest-cov module you might also wanna have a look at pytest configuration settings note:
Note If you have the
pytest-covcoverage module installed, VS Code doesn't stop at breakpoints while debugging becausepytest-covis using the same technique to access the source code being run. To prevent this behavior, include--no-covinpytestArgswhen debugging tests, for example by adding"env": {"PYTEST_ADDOPTS": "--no-cov"}to your debug configuration.
See an example configuration file (launch.json) below:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Tests",
"type": "python",
"request": "test",
"console": "integratedTerminal",
"justMyCode": false,
"env": {"PYTEST_ADDOPTS": "--no-cov"}
}
]
}
Try doing a full rebuild on the application. Pay attention that it's in the "Debug" configuration.
As far as I understand (but I'm not an expert in these things), this can happen when the debug info files (.PDB) are out of sync with the real compiled thing.
People.... I found other solution for breakpoint dont stop. In Attach to Process window on Visual Studio 2010 and using Framework 3.5, by default automatically determines the code types to debug (v2.0, v1.1, v1.0) and (v4.0).
Visual Studio gets confused and automatically determines 2.0 managed code as 4.0 managed code sometimes.
In this case you need to click in "Select..." button on "Attach to" field and select Manage (v2.0, v1.1, v1.0).
Regards
I'm new to using VS Code as I¡ve always used Eclipse IDE. I'm trying to debug my java file in which I've created a breakpoint, but the debugger just runs the code as if there wasn't such breakpoint..
I've seen some other people struggle with this, so here's my launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Java",
"type": "java",
"request": "launch",
"stopOnEntry": true,
"jdkPath": "${env:JAVA_HOME}/bin",
"cwd": "${fileDirname}",
"startupClass": "${fileBasenameNoExtension}",
"classpath": [
".",
"${fileDirname}"
]
},
{
"name": "Java Console App",
"type": "java",
"request": "launch",
"stopOnEntry": true,
"jdkPath": "${env:JAVA_HOME}/bin",
"cwd": "${fileDirname}",
"startupClass": "${fileBasenameNoExtension}",
"classpath": [
".",
"${fileDirname}"
],
"externalConsole": true
},
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "Numeros",
"request": "launch",
"mainClass": "Numeros",
"projectName": "progra_4bad0bd0"
}
]
}Thanks in advance
Perhaps you have pushed the Skip all Breakpoints button in the Breakpoints view.
Thanks guys, this really saved my day too. I antecedently pressed on skip break points, if you did the same this will result on break point appearing with a backslash icon on them.
To bring it back to normal:
- Switch to Debug perspective.
- press on the breakpoints view tap -->> upper right hand corner of the screen, you also can go there by Window->show view-> breakpoints.
- 5th icon from the left you will see break point with backslash. press on that one.
To confirm, try putting break point on any line, and it should appear normally.