Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
751 views
in Technique[技术] by (71.8m points)

gdb - "Run Without Debugging" does stop at a breakpoint in VS Code. A bug or a design?

I am running a simple c++ program and set a breakpoint in VS Code. When I select "Run Without Debugging" DOES stop at the breakpoint. Is this a design or a bug? At least, it acts differently from the good & ole Visual Studio. Thanks in advance.

For your reference, my tasks.jsonis shown below:

        {   // build hellowhox
            "type": "cppbuild",
            "label": "build hellowhox",
            "command": "C:/msys64/mingw64/bin/g++.exe",
            "args": [
                "-g", "-DDEBUG", 
                "-o", "${cwd}/hellowhox", "${cwd}/hellowhox.cpp", 
            ],
            "options": {
                "cwd": "C:/msys64/mingw64/bin"
            },
            "problemMatcher": [ "$gcc" ],
            "group": "build",
            "detail": "compiler: C:/msys64/mingw64/bin/g++.exe"
        },

launch.json as shown below:

    "configurations": [
        {
            "name": "g++.exe",
            "type": "cppdbg",
            "request": "launch",
            "program": "${cwd}/hellowhox.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "C:\msys64\mingw64\bin",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\msys64\mingw64\bin\gdb.exe",
            "setupCommands": [
                {
                    "description": "gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "build hellowhox"
        }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Finally, I got an answer from VS Code-cpptools development team. It is neither a design nor a bug, but not implemented YET.^^

Their response here

For your information:

Duplicate of #5680

The cpptools debuggers (cppvsdbg and cppdbg) do not support run without debugging. We ignore the noDebug boolean in LaunchRequestArguments . We will just start a debug session. This wil need to be implemented.

See: #5680 (comment)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...