Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
985 stars 238 forks source link

Cannot modify variables while debugging #947

Open rohinidr opened 10 months ago

rohinidr commented 10 months ago

Please make you search through our existing issues (both open and closed)

Please visit the correct repo to file an issue. If this is an issue with

Describe the bug VS Code version 1.83.1 Cortex debug After downloading the code to STM device , I am trying to modify one of the static variables during debugging . It fails to updated the variables from Variable window but can modify this variable using terminal . Attached is the snapshot of the error image

{
    "version": "0.2.0",
    "configurations": [
        {
            "liveWatch": {
                "enabled": true,
                "samplesPerSecond": 4
            },
            "name": "Debug Microcontroller - STLink-V2",
            "cwd": "${workspaceFolder}",        // Path from where commands are executed
            "type": "cortex-debug",             // Debug 
            "executable": "${command:cmake.launchTargetPath}", //or fixed file path: build/project-name.elf
            "request": "launch",                // Use "attach" to connect to target w/o elf download
            "servertype": "stlink",             // Use stlink setup of cortex-M debug
            "device": "STM32G473VEH6",          // MCU used
            "interface": "swd",                 // Interface setup
            "runToEntryPoint": "main",          // Run to main and stop there
            "svdFile": "STM32G473xx.svd",         // SVD file to see registers
            "v1": false,
            "gdbPath": "arm-none-eabi-gdb-py",
            "objdumpPath": "arm-none-eabi-objdump",
            "showDevDebugOutput": "none",     // Debug output
            "debuggerArgs": [
                "-iex",
                "set auto-load safe-path /",
            ],
            "preLaunchCommands": [
                "-enable-pretty-printing",
            ]
        }
    ]
}

Could not set variable: Variable object not found (from var-assign stopped_state_status 0x01)

haneefdm commented 9 months ago

Thank you for reporting this issue. We can duplicate this and we are actively working on a fix.

starball5 commented 9 months ago

Related on Stack Overflow: Cannot modify variable value while debugging C code in VS Code with the Cortex Debug extension.

haneefdm commented 9 months ago

The fix has been pushed to this repo. If you have the time to try it out, I can make a private build you can download from GitHub.

Note that it has other unrelated changes we are testing. We will make an official release after the holidays (late Nov)

Thanks again for reporting this issue

rohinidr commented 9 months ago

Thanks for taking care of the issue . I can test it out in couple of days . Let me know when you have the build ready . Thanks

phb98 commented 7 months ago

Hello, Has the fix for this issue been released officially ? I am encountering the same problem.