Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My launch doesn't stop when pre launch task fails... #13022

Open
ialvata opened this issue Dec 5, 2024 · 0 comments
Open

My launch doesn't stop when pre launch task fails... #13022

ialvata opened this issue Dec 5, 2024 · 0 comments

Comments

@ialvata
Copy link

ialvata commented Dec 5, 2024

Discussed in #13019

Originally posted by ialvata December 4, 2024

tasks.json

{
    "tasks": [
        {
            "type": "shell",
            "label": "Build",
            "command": "/usr/bin/g++",
            "args": [
                "-fdiagnostics-color=always",
                "-fmax-errors=1",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        },
        {

            "label": "Confirm",
            "dependsOn": [
                "Build"
            ],
            "command": "${fileDirname}/${fileBasenameNoExtension}",
            "dependsOrder": "sequence",
            "group": "none"
        }
    ],
    "version": "2.0.0"
}

launch.json

{
    "configurations": [
        {
            "name": "C/C++: gcc build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "Build",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ],
    "version": "2.0.0"
}

Then when I launch vscode, in the build process shell, I get:

  • The terminal process "/usr/bin/bash '-c', '/usr/bin/g++ -fdiagnostics-color=always -fmax-errors=1 -g '/home/ivo/Trabalho/cpp_gaddis/Gaddis-CPP_10e_SourceCode/Chapter 12/Pr12-6.cpp' -o '/home/ivo/Trabalho/cpp_gaddis/Gaddis-CPP_10e_SourceCode/Chapter 12/Pr12-6''" terminated with exit code: 1.

And yet, the launch still continues, by running an old version of the executable.

I've search and found this closed thread... They suggest to issue against the C/C++ extension, however this doesn't solve my problem. Also, the build also terminates with error code 1, which supposedly should work according to user @weinand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant