Describe the bug
When debugging an ARM executable, the static variable section in the variable pane always stays empty, even if there are static variables in the source file.
To Reproduce
Steps to reproduce the behavior:
- Start debug session
- Break in any source file with static variables
- Expand the static variable
- See issue
Expected behavior
Static variables should show up
Screenshots

Environment:
- Cortex-Debug Version v1.12
- OS: Windows 10
- GDB Version: 10.1.90.20201028-git
- Compiler Toolchain Version: arm-none-eabi 10.2_2020q4
Please include launch.json
{
"configurations": [
{
"cwd": "${workspaceFolder}",
"executable": "build/demo.axf",
"name": "Debug with JLink",
"request": "launch",
"type": "cortex-debug",
"servertype": "jlink",
"serverpath": "${workspaceFolder}/tools/SEGGER/JLink/JLinkGDBServerCL.exe",
"armToolchainPath": "${workspaceFolder}/tools/10.2_2020q4/bin",
"device": "EFR32BG22CxxxF512",
"interface": "swd",
"serialNumber": "",
"liveWatch": {
"enabled": false,
"samplesPerSecond": 20
},
"numberOfProcessors": 1,
"showDevDebugOutput": "raw",
"runToEntryPoint": "main",
"debugServer": 4711
},
]
}
Attach text from Debug Console
41-var-create static_var_'C:\Users\root\git\efr32-basicproject\src\main.c'::StaticVar_8127f1e9ff079ff59d7a58f4fc9935d0eaf0656650939d3f8e31eadd241c5c34 @ "'C:\Users\root\git\efr32-basicproject\src\main.c'::StaticVar"
-> 41^error,msg="-var-create: unable to create variable object"
Could not create global/static variable 'C:\Users\root\git\efr32-basicproject\src\main.c'::StaticVar
Error: -var-create: unable to create variable object (from var-create static_var_'C:\Users\root\git\efr32-basicproject\src\main.c'::StaticVar_8127f1e9ff079ff59d7a58f4fc9935d0eaf0656650939d3f8e31eadd241c5c34 @ "'C:\Users\root\git\efr32-basicproject\src\main.c'::StaticVar")
Additional context
I did a bisect and the first bad commit is 2f07c52
I looked at the source code and it seems the issue is in gdb.ts staticVariablesRequest(). Here the exprName which is passed to gdb is prefixed with the filename. This causes the gdb server to throw an error.
Describe the bug
When debugging an ARM executable, the static variable section in the variable pane always stays empty, even if there are static variables in the source file.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Static variables should show up
Screenshots

Environment:
Please include
launch.jsonAttach text from
Debug ConsoleAdditional context
I did a bisect and the first bad commit is 2f07c52
I looked at the source code and it seems the issue is in gdb.ts staticVariablesRequest(). Here the exprName which is passed to gdb is prefixed with the filename. This causes the gdb server to throw an error.