# Debugging in Visual Studio Code with Conda environment

**URL:** <https://fortran-lang.discourse.group/t/debugging-in-visual-studio-code-with-conda-environment/8942>\
**Category:** Visual Studio Code\
**Created:** [December 9, 2024, 7:03pm UTC](https://fortran-lang.discourse.group/t/debugging-in-visual-studio-code-with-conda-environment/8942 "2024-12-09T19:03:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FQVBSina](https://avatars.discourse-cdn.com/v4/letter/f/e480ec/32.png) [@FQVBSina](https://fortran-lang.discourse.group/u/FQVBSina)\
**Post date:** [December 9, 2024, 7:03pm UTC](https://fortran-lang.discourse.group/t/debugging-in-visual-studio-code-with-conda-environment/8942/1 "2024-12-09T19:03:53Z")

</div>

Previously, I installed the VSCode extension “Fortran Breakpoint Support” which is incompatible with “Modern Fortran”. However, with the breakpoint support and the following launch.json, I was able to run the code in debug mode, pause it, and see that it stops at a line in the code files. However, for some reason, I was not able to place breakpoints via the GUI. So I thought: if I can use the launch.json to run debug mode with the breakpoint support, surely I can do the same with Modern Fortran. However, with Modern Fortran, it immediately complains that “cppdbg” is not supported. Why is it not supported, and what do I need to do to make it work?

```auto
{
    // 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": "(gdb) Fortran",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/src/LApx-dbg",
        "args": [], // Possible input args for a.out
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}/example_inputs/TestEigen_CircleIsotropic_SameStiff",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
          {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
          }
        ]
      }
    ]
  }

```

---

<div class="post-metadata">

**Author:** ![FQVBSina](https://avatars.discourse-cdn.com/v4/letter/f/e480ec/32.png) [@FQVBSina](https://fortran-lang.discourse.group/u/FQVBSina)\
**Post date:** [December 10, 2024, 10:21pm UTC](https://fortran-lang.discourse.group/t/debugging-in-visual-studio-code-with-conda-environment/8942/2 "2024-12-10T22:21:07Z")

</div>

Even though this forum seems to be pretty dead, but in case anyone else found this in the future, I fixed the issue of cppdbg by installing C/C++ Runner and then with the launch.json above, I was able to debug my Fortran code.

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [December 10, 2024, 10:35pm UTC](https://fortran-lang.discourse.group/t/debugging-in-visual-studio-code-with-conda-environment/8942/3 "2024-12-10T22:35:34Z")

</div>

@FQVBSina welcome to the forum. I am happy you were able to figure it out. Go ahead and report the issue at the `fortls` github repository: [GitHub · Where software is built](https://github.com/fortran-lang/fortls/issues)
