Skip to content

My breakpoints are completely ignored #420

Open

Description

@iamalsonothere

When i configure the GDB debug in launch.json and add a pre task to compile it, all it does is launch the binary. Doesnt even attempt at debugging it, does not acknowledge that any breakpoints exist.

I am using VSCodium 1.87.2

$ gdb --version
GNU gdb (GDB) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Activity

  1. plowsters commented on Jul 7, 2024

    @plowsters

    I had the same issue on VSCodium 1.90.2, and I got it to work. CMake successfully builds the executable, but gdb ignores all breakpoints. Fixed with this launch.json configuration:

    {
      "version": "0.2.0",
      "configurations": [
        {
          "name": "GDB Debug",
          "type": "gdb",
          "request": "launch",
          "cwd": "${workspaceFolder}",
          "target": "${workspaceFolder}/build/[executable name]",
          "stopAtEntry": false,
          "arguments": "",
          "valuesFormatting": "prettyPrinters"
        }
      ]
    }
    
  2. plowsters commented on Jul 7, 2024

    @plowsters

    Additionally, these are the build tasks I wrote in tasks.json:

    "version": "2.0.0",
      "tasks": [
        {
          "label": "CMake configure",
          "type": "process",
          "command": "cmake",
          "args": [
            "-S",
            "${workspaceFolder}",
            "-B",
            "${workspaceFolder}/build",
            "-DCMAKE_BUILD_TYPE=Debug"
          ],
          "group": {
            "kind": "build",
            "isDefault": false
          },
          "problemMatcher": [
            {
              "owner": "cpp",
              "fileLocation": ["relative", "${workspaceFolder}"],
              "pattern": {
                "regexp": "^(.*?):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
                "file": 1,
                "line": 2,
                "column": 3,
                "severity": 4,
                "message": 5
              }
            }
          ],
          "detail": "Configure the project using CMake"
        },
        {
          "label": "CMake build",
          "type": "process",
          "command": "cmake",
          "args": [
            "--build",
            "${workspaceFolder}/build"
          ],
          "group": {
            "kind": "build",
            "isDefault": true
          },
          "problemMatcher": [
            {
              "owner": "cpp",
              "fileLocation": ["relative", "${workspaceFolder}"],
              "pattern": {
                "regexp": "^(.*?):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
                "file": 1,
                "line": 2,
                "column": 3,
                "severity": 4,
                "message": 5
              }
            }
          ],
          "detail": "Build the project using CMake"
        }
      ]
    }
    

    And here is the CMakeLists.txt used to build it:

    cmake_minimum_required(VERSION 3.23)
    
    project(BugHTTPServer)
    
    set(CMAKE_C_STANDARD 23)
    set(CMAKE_C_STANDARD_REQUIRED ON)
    
    add_executable(BugHTTPServer http_server.c)
    
    set(CMAKE_BUILD_TYPE Debug)
    
  3. GitMensch commented on Jul 8, 2024

    @GitMensch
    Collaborator
  4. plowsters commented on Jul 8, 2024

    @plowsters

    I was originally trying to launch it in the VSCodium terminal using

    "terminal": "integrated"
    

    Removing this line fixed the issue for me, and it loads in VSCodium by default anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions