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
    },
  ]
}
Answer from Marco Graziano on Stack Overflow
🌐
Reddit
reddit.com › r/vscode › vs code debug not stopping on breakpoints
r/vscode on Reddit: VS Code debug not stopping on breakpoints
June 10, 2023 -

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

Discussions

Debugger not stopping on breakpoints
Type: Debugger Input information below Describe the bug OS and Version: Ubuntu 16.04 VS Code Version: 1.28.2 C/C++ Extension Version: 0.20.1 A clear and concise description of what the bug is - I a... More on github.com
🌐 github.com
3
November 15, 2018
python - VSCode: Why isn't debugger stopping at breakpoints? - Stack Overflow
Just My Code is a set of features ...omnisharp-vscode/blob/master/…). But I'm running a program I wrote which contains a few simple lines, and no calls to any modules. Can anyone throw any light on why I need to turn this feature off? 2021-08-14T10:56:30.24Z+00:00 ... 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-cov coverage module installed, VS Code doesn't stop at breakpoints while debugging because pytest-cov ... More on stackoverflow.com
🌐 stackoverflow.com
debugging - VSCode Debug C++: Why does the flow not stop at breakpoint? - Stack Overflow
VSCode Version:1.3.1 OS Version:Ubuntu 14.04 I debug a C++ project on Ubuntu 14.04. I run cmake to produce an executable file and setting VSCode config file. When I press F5 to debug, the program ... More on stackoverflow.com
🌐 stackoverflow.com
Debugger doesn't stop at breakpoints when running tests (but does during normal execution)
Julia 1.7.3 VS Code 1.74.3 Julia extension 1.38.2 I’m having a problem where, when I run tests with the debugger on the program I’m working on, the debugger doesn’t stop at any breakpoints I set. If I run the program normally (meaning executing a main function) with the debugger, the ... More on discourse.julialang.org
🌐 discourse.julialang.org
11
1
January 19, 2023
🌐
Microsoft Learn
learn.microsoft.com › en-us › troubleshoot › developer › visualstudio › debuggers › troubleshooting-breakpoints
Troubleshoot breakpoints in the debugger - Visual Studio | Microsoft Learn
September 17, 2025 - If you deleted a breakpoint while debugging, you may hit the breakpoint again the next time you start debugging. To stop hitting this breakpoint, make sure all the instances of the breakpoint are removed from the Breakpoints window.
🌐
Developer Community
developercommunity.visualstudio.com › t › Program-execution-doesnt-stop-on-breakp › 1494369
Program execution doesn't stop on breakpoints when ...
Skip to main content · Visual Studio · Guidelines Problems Suggestions Code of Conduct · Downloads · Visual Studio IDE Visual Studio Code Azure DevOps Team Foundation Server Accounts and Subscriptions · Subscriber Access · Microsoft Security Azure Dynamics 365 Microsoft 365 Microsoft ...
🌐
GitHub
github.com › Microsoft › vscode-cpptools › issues › 2830
Debugger not stopping on breakpoints · Issue #2830 · microsoft/vscode-cpptools
November 15, 2018 - A clear and concise description of what the bug is - I am trying to debug a C program but when running the debugger, it does not stop at the breakpoints set in the gutter.
Author   dsinecos
Find elsewhere
Top answer
1 of 3
51

Watch out, how you compile your code:
In order to be able to debug you need to compile e.g. with g++ with the flag -g.

2 of 3
3

I have had this same problem for a while and am now able to write a working configuration which works universally for all C and CPP programs and you don't need to change anything during execution.

  • Install Code-Runner Extention.
  • Paste the configuration given below into your settings.json file.

     {
       "code-runner.executorMap": {
    
        "javascript": "nodejs",
        "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
        "c": "cd $dir && gcc -g \"$fileName\" -o \"$fileNameWithoutExt\" && $dir\"$fileNameWithoutExt\"",
        "cpp": "cd $dir && g++ -g \"$fileName\" -o \"$fileNameWithoutExt\" && $dir\"$fileNameWithoutExt\"",
        "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "php": "php",
        "python": "python3",
        "perl": "perl",
        "ruby": "ruby",
        "go": "go run",
        "lua": "lua",
        "groovy": "groovy",
        "powershell": "powershell -ExecutionPolicy ByPass -File",
        "bat": "cmd /c",
        "shellscript": "bash",
        "fsharp": "fsi",
        "csharp": "scriptcs",
        "vbscript": "cscript //Nologo",
        "typescript": "ts-node",
        "coffeescript": "coffee",
        "scala": "scala",
        "swift": "swift",
        "julia": "julia",
        "crystal": "crystal",
        "ocaml": "ocaml",
        "r": "Rscript",
        "applescript": "osascript",
        "clojure": "lein exec",
        "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
        "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
        "racket": "racket",
        "ahk": "autohotkey",
        "autoit": "autoit3",
        "kotlin": "cd $dir && kotlinc $fileName -include-runtime -d $fileNameWithoutExt.jar && java -jar $fileNameWithoutExt.jar",
        "dart": "dart",
        "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
        "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
        "haskell": "runhaskell",
        "nim": "nim compile --verbosity:0 --hints:off --run"
    }
    }
    
  • Paste the below code in launch.json by clicking the settings symbol in the debugging panel (present at top left).

    {
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
      ]
    }
    
  • After this When ever you press ctrl+Alt+N it compiles and executes and you can see the output in the output panel.

  • When You Press F5 after selecting the right Task ( choose (gdb)Launch ). It will start the debugging with working break points and stuff.

🌐
Julia Programming Language
discourse.julialang.org › tooling › vs code
Debugger doesn't stop at breakpoints when running tests (but does during normal execution) - VS Code - Julia Programming Language
January 19, 2023 - Julia 1.7.3 VS Code 1.74.3 Julia extension 1.38.2 I’m having a problem where, when I run tests with the debugger on the program I’m working on, the debugger doesn’t stop at any breakpoints I set. If I run the program normally (meaning executing a main function) with the debugger, the ...
🌐
GitHub
github.com › golang › vscode-go › issues › 2417
VSCode Breakpoint not hitting/stopping when run in debugger mode - Golang · Issue #2417 · golang/vscode-go
August 18, 2022 - Run Preferences: Open Settings (JSON) command to open your settings.json file. Share all the settings with the go. or ["go"] or gopls prefixes. When Start Debugging is fired, the program runs successfully. However the program doesn't stop at breakpoints. Breakpoint is enabled and placed alright.
Author   riderrocks
🌐
GitHub
github.com › microsoft › vscode-cpptools › issues › 4357
Debugger not stopping on breakpoints on macOS Catalina · Issue #4357 · microsoft/vscode-cpptools
October 9, 2019 - I also ran the debugger manually from the command line and confirmed that breakpoints don't get set: $ /Users/brandonhsiao/.vscode/extensions/ms-vscode.cpptools-0.25.1/debugAdapters/lldb/bin/lldb-mi ./ide (gdb) -file-exec-and-symbols "./ide" ^done (gdb) =library-loaded,id="./ide",target-name="./ide",host-name="./ide",symbols-loaded="1",symbols-path="/System/Volumes/Data/Users/brandonhsiao/monorepo/ide.dSYM/Contents/Resources/DWARF/ide",loaded_addr="-",size="552960" breakpoint set -f main.cpp -l 4 Breakpoint 1: where = ide`main + 15 at main.cpp:4, address = 0x0000000100000e9f ^done (gdb) =break
Author   ghost
🌐
PlatformIO Community
community.platformio.org › advanced solutions › debugging
Debugger stopped working in VSCode - Debugging - PlatformIO Community
February 4, 2022 - I’ve been using PIO debugger in VSCode without issues for 2+ years but recently it stopped working. I am using VSCode 1.64.0 with PIO 5.2.4 on Windows 10 and I have disabled all VSCode extensions except for PIO and Microsoft C/C++. I am able to run “pio debug --interface=gdb -x .pioinit” and it starts fine stopping at the specified initial breakpoint.
🌐
GitHub
github.com › microsoft › vscode-cpptools › issues › 3278
debugger doesn't hit breakpoint in my c++ "helloworld" programe · Issue #3278 · microsoft/vscode-cpptools
March 11, 2019 - // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, //this will call a dos prompt window for cin and cout "MIMode": "gdb", "miDebuggerPath": "C:\\MinGWx64\\gcc\\bin\\gdb.exe", "preLaunchTask": "g++", //this must same as command in task.json "logging": {"trace": true, "traceResponse": true, "engineLogging": true, "exceptions": true, "moduleLoad": true, "programOutput": true}, "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] }
Author   nathanzh
🌐
w3tutorials
w3tutorials.net › blog › vs-code-is-ignoring-the-breakpoint-in-c-debugging
VS Code C++ Debugger Not Stopping at Breakpoints: Exits Normally with Debug Console Message – How to Fix with launch.json Configuration
This frustrating issue is a common roadblock for developers, often stemming from misconfigurations in VS Code’s debugging setup—specifically in the launch.json file. Breakpoints rely on debug symbols (metadata embedded in the executable) and precise debugger configuration to work.
🌐
Visual Studio Code
code.visualstudio.com › docs › debugtest › debugging
Debug code with Visual Studio Code
November 3, 2021 - Copilot in VS Code can help generate the launch.json file for you. For more information, see Use Copilot to generate debugging configurations. Set breakpoints in your code.
🌐
Reddit
reddit.com › r/vscode › vscode debug c++: why does the flow not stop at breakpoint?
r/vscode on Reddit: VSCode Debug C++: Why does the flow not stop at breakpoint?
March 29, 2021 - I am using WSL in VS code. The program mentioned above is in build/bin folder. Which is built by cmake commands. but when I try to run test_api. It does not hit the breakpoint(I have given breakpoint in test_api.cpp file which is in root of the sdk folder), why ?
🌐
GitHub
github.com › vitest-dev › vitest › issues › 5380
Debugger in vs-code does not stop at breakpoint but elsewhere · Issue #5380 · vitest-dev/vitest
March 13, 2024 - Run the test and watch where debugger stops Result: Debugger stops at wrong line Expected: Debugger should stop at correct line · Issue goes away when removing <style>...</style> section in .vue file ... <template> <div>Hi {{ name }}</div> <div>Good</div> </template> <script setup> import { ref } from 'vue' const name = ref("Peter") console.log("Nothing special") // set breakpoint here </script> <style> .useless { color: green; } </style>
Author   bonham
🌐
GitHub
github.com › Microsoft › vscode-cpptools › issues › 416
can't stop at the breakpoint · Issue #416 · microsoft/vscode-cpptools
December 19, 2016 - 1.launch.json set as below: { "version": "0.2.0", "configurations": [ { "name": "C++ Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceRoot}/build/tools/caffe.bin", "args": ["train","--solver=examples/mnist/lenet_solver.prototxt"], "stopAtEntry": false, "cwd": "${workspaceRoot}", "environment": [], "externalConsole": true, "preLaunchTask": "build", "linux": { "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] }, "osx": { "MIMode": "lldb" }, "windows": { "MIMode": "gdb", "setup
Author   egamma
🌐
GitHub
github.com › microsoft › vscode-js-debug › issues › 660
Debugger not stopping on breakpoints · Issue #660 · microsoft/vscode-js-debug
July 26, 2020 - I am not using NPM scripts etc, this is directly debugging a file via profile. Attaching to a script and not launching it is still working. My launch configuration for that project: { "type": "node", "request": "attach", "name": "Docker", "address": "localhost", "port": 9230, "restart": true, "localRoot": "${workspaceFolder}", "remoteRoot": "/app" }, I noticed when looking into other submitted trace files that I'm missing an "args" array for the "command":"launch" line.
Author   jonathanrdelgado
🌐
Medium
medium.com › front-end-weekly › solve-breakpoint-ignored-with-visual-studio-code-vscode-1-19-chrome-debugger-6d484c88b829
Solve “Breakpoint ignored” with Visual Studio code (vscode 1.19+) Chrome debugger | by Ananto Ghosh | Frontend Weekly | Medium
March 8, 2018 - Any code with breakpoints executed before vscode could attach, will not trigger the breakpoint. To solve this, either restart the debugger after it has initially loaded (keep Chrome open).