microsoft / microsoft/vscode-cpptools

[Fortran] debugger only shows the first 1000 elements of arrays

Open
#10,406 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Windows 10 Version 10.0.19045
  • VS Code: 1.74.3
  • C/C++ extension: 1.13.9
  • GDB / LLDB version: mingw-w64 12.1
Bug Summary and Steps to Reproduce

Hello,
I am trying to debug a Fortran program using cppdbg but vscode only shows 1000 elements. I am able to see the other elements by manually writing expressions in the watch window for each section but the size of the arrays are dynamic, so this is not a viable solution.
It also seems like that this was an old problem that was fixed in a previous version (1.13.6) but I do not know why it happens in my case.

Debugger Configurations
launch.json:
{
    // 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": "Fdebugger Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/myapp",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "preLaunchTask": "build",
            "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "text": "-enable-pretty-printing",
                    "description": "Enable GDB pretty printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ]
        },
    ]
}
tasks.json:
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "command": "make -f Makefile",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "reveal": "silent",
                "panel": "shared"
            },
            "problemMatcher": []
        }
    ]
}
Makefile:
########################################################################
####################### Makefile Template ##############################
########################################################################

# Compiler settings - Can be customized.
CC = gfortran
CPP = gfortran -cpp
CXXFLAGS = -g -O0 -Wall -Wextra -fopenmp  
LDFLAGS = 

# Makefile settings - Can be customized.
APPNAME = myapp
EXT = .f90
SRCDIR = src
OBJDIR = obj

############## Do not change anything from here downwards! #############
Debugger Logs
NA
Other Extensions

I am using Modern Fortran and gfortran compiler, if that is relevant.

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report using the supplied launch.json, tasks.json, and Makefile with gfortran and GDB on Windows. Capture debugger logs and trace how cppdbg renders dynamic Fortran arrays; done means the full array is visible without manually entering slice expressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.