DRAGON VS Code Debug Setup Instructions

  1. Download & Install Static GDB
    • Visit GDB release to download.
    • Extract to a directory you own, e.g. ~/local/gdb-static-full-aarch64/.
  2. Create VS Code Workspace Folder

    In your DRAGON project root, create a folder named .vscode/.

  3. Copy Helper Scripts

    Place these into .vscode/ and make them executable:

    prepare-rdragon.sh
    launch.json
    tasks.json
            

    Then run:

    chmod +x .vscode/prepare-rdragon.sh
            
  4. Configure launch.json
    • Set miDebuggerPath to your GDB binary.
    • Adjust sourceFileMap.
  5. Install VS Code Extensions
    • C/C++
    • C/C++ Extension Pack
  6. Recompile DRAGON with Debug Symbols

    From project root:

    make clean
    make -C src FFLAGS="-O0 -g" CFLAGS="-O0 -g" LDFLAGS="-g"
            
  7. Launch the Debugger
    • Select “Debug DRAGON” in the Run & Debug view.
    • Press F5 (or ▶️) to build, launch GDB, and begin debugging.
    • Enter your x2m filename, for example: tmacro.x2m

That’s it! You should now be able to set breakpoints, step through your Fortran/C code, and inspect variables in VS Code.