Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
1.01k stars 240 forks source link

V1.12.1 does not kill openocd process after pressing stop button (Inside Devcontainer) #963

Open nojas15 opened 11 months ago

nojas15 commented 11 months ago

Describe the bug I use VSCode on a Windows Machine. I have setup a Devcontainer within which I debug and develop. When I start the first Debugging session everything seems to work (First debugging session after building the devcontainer). I'm not 100% sure if I get some errors already in the console (console content posted further down). Then I stop the debugging session and it stops as expected. If I want to start a second debugging session I get following error message from openocd:

[2023-12-01T17:24:17.793Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
extern/start_openocd.sh -c "gdb_port 50003" -c "tcl_port 50004" -c "telnet_port 50005" -s /workspaces/hybrid-control-unit/extern/ -f /home/vscode/.vscode-server/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl -f /usr/share/openocd/scripts/interface/stlink.cfg -f /usr/share/openocd/scripts/target/stm32h7x.cfg
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
CDLiveWatchSetup
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 50004 for tcl connections
Info : Listening on port 50005 for telnet connections
Info : clock speed 1800 kHz

[2023-12-01T17:24:17.862Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

When I check with "top" I can see there is still a openocd process running. If I kill it, it works as expected.

If I click "Reset" or "Restart" everything also works as expected (in the debug console)

To Reproduce Steps to reproduce the behavior: See above

Expected behavior

OpenOCD process should be stopped and I can start a second debug session.

Screenshots

-

Environment (please complete the following information):

I use usbipd to forward the USB port to the WSL and then I use the privileged option to use the usb ports within the dockercontainer. I use a user inside the devcontainer because I had issues with git when using root to commit everything. Therefore I have to use a start_openocd.sh script which starts openocd for me as sudo. Maybe this is the issue?

#!/bin/sh
sudo openocd "$@"

Please include launch.json

Note: We are unlikely to look at the issue if you do not supply this

{
            "name": "HCU v04 Debug launch",
            "type": "cortex-debug",
            "request": "launch",
            "executable": "${workspaceRoot}/eft-h1x-hcu/build/nucleo-h7a3_v0-4-0.out",
            "interface": "swd",
            "servertype": "openocd",
            //"serverpath": "openocd",
            "serverpath": "extern/start_openocd.sh",
            "cwd": "${workspaceRoot}",
            "armToolchainPath": "/usr/bin",
            "gdbPath": "gdb-multiarch",
            "searchDir": [
                "${workspaceRoot}/extern/"
            ],
            "configFiles": [
                "/usr/share/openocd/scripts/interface/stlink.cfg",
                "/usr/share/openocd/scripts/target/stm32h7x.cfg"
            ],
            // "valuesFormatting": "parseText",
            "showDevDebugOutput": "raw",
            // "autorun": [
            //     "interrupt",
            //     "load",
            //     "monitor arm semihosting enable"
            // ],
            // "stopAtEntry": true,
            "svdFile": "${workspaceFolder}/extern/STM32H7A3x.svd",
            "runToEntryPoint": "main",
            "preLaunchTask": "eft-h1x-hcu-v04-buildjob", // Build before debugging
        },

Attach text from Debug Console

This is when it does not work:

Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usage
"configuration": {
    "name": "HCU v04 Debug launch",
    "type": "cortex-debug",
    "request": "launch",
    "executable": "/workspaces/hybrid-control-unit/eft-h1x-hcu/build/nucleo-h7a3_v0-4-0.out",
    "interface": "swd",
    "servertype": "openocd",
    "serverpath": "extern/start_openocd.sh",
    "cwd": "/workspaces/hybrid-control-unit",
    "armToolchainPath": "/usr/bin",
    "gdbPath": "gdb-multiarch",
    "searchDir": [
        "/workspaces/hybrid-control-unit/extern/"
    ],
    "configFiles": [
        "/usr/share/openocd/scripts/interface/stlink.cfg",
        "/usr/share/openocd/scripts/target/stm32h7x.cfg"
    ],
    "showDevDebugOutput": "raw",
    "svdFile": "/workspaces/hybrid-control-unit/extern/STM32H7A3x.svd",
    "runToEntryPoint": "main",
    "preLaunchTask": "eft-h1x-hcu-v04-buildjob",
    "__configurationTarget": 6,
    "gdbServerConsolePort": 55878,
    "pvtAvoidPorts": [],
    "chainedConfigurations": {
        "enabled": false
    },
    "debuggerArgs": [],
    "swoConfig": {
        "enabled": false,
        "decoders": [],
        "cpuFrequency": 0,
        "swoFrequency": 0,
        "source": "probe"
    },
    "rttConfig": {
        "enabled": false,
        "decoders": []
    },
    "graphConfig": [],
    "preLaunchCommands": [],
    "postLaunchCommands": [],
    "preAttachCommands": [],
    "postAttachCommands": [],
    "preRestartCommands": [],
    "postRestartCommands": [],
    "preResetCommands": [],
    "postResetCommands": [],
    "toolchainPath": "/usr/bin",
    "toolchainPrefix": "arm-none-eabi",
    "extensionPath": "/home/vscode/.vscode-server/extensions/marus25.cortex-debug-1.12.1",
    "registerUseNaturalFormat": true,
    "variableUseNaturalFormat": true,
    "pvtVersion": "1.12.1",
    "__sessionId": "be39c4c9-163a-41eb-a84a-ad8aa30c7713",
    "pvtShowDevDebugOutput": "raw"
}
Reading symbols from /usr/bin/arm-none-eabi-objdump --syms -C -h -w /workspaces/hybrid-control-unit/eft-h1x-hcu/build/nucleo-h7a3_v0-4-0.out
Reading symbols from /usr/bin/arm-none-eabi-nm --defined-only -S -l -C -p /workspaces/hybrid-control-unit/eft-h1x-hcu/build/nucleo-h7a3_v0-4-0.out
Launching GDB: gdb-multiarch -q --interpreter=mi2
1-gdb-version
Launching gdb-server: extern/start_openocd.sh -c "gdb_port 50003" -c "tcl_port 50004" -c "telnet_port 50005" -s /workspaces/hybrid-control-unit/extern/ -f /home/vscode/.vscode-server/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl -f /usr/share/openocd/scripts/interface/stlink.cfg -f /usr/share/openocd/scripts/target/stm32h7x.cfg
    Please check TERMINAL tab (gdb-server) for output from extern/start_openocd.sh
Finished reading symbols from objdump: Time: 36 ms
Finished reading symbols from nm: Time: 76 ms
-> =thread-group-added,id="i1"
-> ~"GNU gdb (Debian 13.1-3) 13.1\n"
-> ~"Copyright (C) 2023 Free Software Foundation, Inc.\n"
-> ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
-> ~"\nType \"show copying\" and \"show warranty\" for details.\n"
-> ~"This GDB was configured as \"x86_64-linux-gnu\".\n"
-> ~"Type \"show configuration\" for configuration details.\n"
-> ~"For bug reporting instructions, please see:\n"
-> ~"<https://www.gnu.org/software/gdb/bugs/>.\n"
-> ~"Find the GDB manual and other documentation resources online at:\n    <"
-> ~"http://www.gnu.org/software/gdb/documentation/>.\n\n"
-> ~"For help, type \"help\".\n"
-> ~"Type \"apropos word\" to search for commands related to \"word\".\n"
-> 1^done
2-gdb-set mi-async on
OpenOCD: GDB Server Quit Unexpectedly. See gdb-server output in TERMINAL tab for more details.

This is when it works:

Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usage
"configuration": {
    "name": "HCU v04 Debug launch",
    "type": "cortex-debug",
    "request": "launch",
    "executable": "/workspaces/hybrid-control-unit/eft-h1x-hcu/build/nucleo-h7a3_v0-4-0.out",
    "interface": "swd",
    "servertype": "openocd",
    "serverpath": "extern/start_openocd.sh",
    "cwd": "/workspaces/hybrid-control-unit",
    "armToolchainPath": "/usr/bin",
    "gdbPath": "gdb-multiarch",
    "searchDir": [
        "/workspaces/hybrid-control-unit/extern/"
    ],
    "configFiles": [
        "/usr/share/openocd/scripts/interface/stlink.cfg",
        "/usr/share/openocd/scripts/target/stm32h7x.cfg"
    ],
    "showDevDebugOutput": "raw",
    "svdFile": "/workspaces/hybrid-control-unit/extern/STM32H7A3x.svd",
    "runToEntryPoint": "main",
    "preLaunchTask": "eft-h1x-hcu-v04-buildjob",
    "__configurationTarget": 6,
    "gdbServerConsolePort": 55878,
    "pvtAvoidPorts": [],
    "chainedConfigurations": {
        "enabled": false
    },
    "debuggerArgs": [],
    "swoConfig": {
        "enabled": false,
        "decoders": [],
        "cpuFrequency": 0,
        "swoFrequency": 0,
        "source": "probe"
    },
    "rttConfig": {
        "enabled": false,
        "decoders": []
    },
    "graphConfig": [],
    "preLaunchCommands": [],
    "postLaunchCommands": [],
    "preAttachCommands": [],
    "postAttachCommands": [],
    "preRestartCommands": [],
    "postRestartCommands": [],
    "preResetCommands": [],
    "postResetCommands": [],
    "toolchainPath": "/usr/bin",
    "toolchainPrefix": "arm-none-eabi",
    "extensionPath": "/home/vscode/.vscode-server/extensions/marus25.cortex-debug-1.12.1",
    "registerUseNaturalFormat": true,
    "variableUseNaturalFormat": true,
    "pvtVersion": "1.12.1",
    "__sessionId": "5b0205e1-7b62-45c8-9379-d41096519581",
    "pvtShowDevDebugOutput": "raw"
}
Reading symbols from /usr/bin/arm-none-eabi-objdump --syms -C -h -w /workspaces/hybrid-control-unit/eft-h1x-hcu/build/nucleo-h7a3_v0-4-0.out
Reading symbols from /usr/bin/arm-none-eabi-nm --defined-only -S -l -C -p /workspaces/hybrid-control-unit/eft-h1x-hcu/build/nucleo-h7a3_v0-4-0.out
Launching GDB: gdb-multiarch -q --interpreter=mi2
1-gdb-version
Launching gdb-server: extern/start_openocd.sh -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /workspaces/hybrid-control-unit/extern/ -f /home/vscode/.vscode-server/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl -f /usr/share/openocd/scripts/interface/stlink.cfg -f /usr/share/openocd/scripts/target/stm32h7x.cfg
    Please check TERMINAL tab (gdb-server) for output from extern/start_openocd.sh
Finished reading symbols from objdump: Time: 40 ms
Finished reading symbols from nm: Time: 95 ms
-> =thread-group-added,id="i1"
-> ~"GNU gdb (Debian 13.1-3) 13.1\n"
-> ~"Copyright (C) 2023 Free Software Foundation, Inc.\n"
-> ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
-> ~"\nType \"show copying\" and \"show warranty\" for details.\n"
-> ~"This GDB was configured as \"x86_64-linux-gnu\".\n"
-> ~"Type \"show configuration\" for configuration details.\n"
-> ~"For bug reporting instructions, please see:\n"
-> ~"<https://www.gnu.org/software/gdb/bugs/>.\n"
-> ~"Find the GDB manual and other documentation resources online at:\n    <"
-> ~"http://www.gnu.org/software/gdb/documentation/>.\n\n"
-> ~"For help, type \"help\".\n"
-> ~"Type \"apropos word\" to search for commands related to \"word\".\n"
-> 1^done
2-gdb-set mi-async on
-> 2^done
3-interpreter-exec console "set print demangle on"
-> 3^done
4-interpreter-exec console "set print asm-demangle on"
-> =cmd-param-changed,param="print asm-demangle",value="on"
-> 4^done
5-enable-pretty-printing
-> 5^done
6-interpreter-exec console "source /home/vscode/.vscode-server/extensions/marus25.cortex-debug-1.12.1/support/gdbsupport.init"
-> 6^done
7-interpreter-exec console "source /home/vscode/.vscode-server/extensions/marus25.cortex-debug-1.12.1/support/gdb-swo.init"
-> =cmd-param-changed,param="language",value="c"
-> =cmd-param-changed,param="language",value="auto"
-> 7^done
8-interpreter-exec console "set output-radix 0xa"
-> ~"Output radix now set to decimal 10, hex a, octal 12.\n"
Output radix now set to decimal 10, hex a, octal 12.
-> 8^done
9-interpreter-exec console "set input-radix 0xa"
-> ~"Input radix now set to decimal 10, hex a, octal 12.\n"
Input radix now set to decimal 10, hex a, octal 12.
-> 9^done
10-file-exec-and-symbols "/workspaces/hybrid-control-unit/eft-h1x-hcu/build/nucleo-h7a3_v0-4-0.out"
-> 10^done
11-target-select extended-remote localhost:50000
-> =thread-group-started,id="i1",pid="42000"
-> =thread-created,id="1",group-id="i1"
-> ~"rotax_controller () at /workspaces/hybrid-control-unit/eft-h1x-hcu/src/customers/rotax_controller.c:91\n"
rotax_controller () at /workspaces/hybrid-control-unit/eft-h1x-hcu/src/customers/rotax_controller.c:91
-> ~"91\t    if (EEPROM_configv1.customer != CUSTOMER_ROTAX)\n"
91      if (EEPROM_configv1.customer != CUSTOMER_ROTAX)
-> *stopped,frame={addr="0x0801aa94",func="rotax_controller",args=[],file="/workspaces/hybrid-control-unit/eft-h1x-hcu/src/customers/rotax_controller.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/src/customers/rotax_controller.c",line="91",arch="armv7e-m"},thread-id="1",stopped-threads="all"
mi2.status = stopped
Program stopped, probably due to a reset and/or halt issued by debugger
-> 11^connected
12-interpreter-exec console "monitor reset halt"
-> @"[stm32h7x.cpu0] halted due to debug-request, current mode: Thread \n"
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread
-> @"xPSR: 0x01000000 pc: 0x08010a28 msp: 0x24100000\n"
xPSR: 0x01000000 pc: 0x08010a28 msp: 0x24100000
-> 12^done
13-target-download
-> 13+download,{section=".isr_vector",section-size="684",total-size="1936926"}
-> 13+download,{section=".isr_vector",section-sent="684",section-size="684",total-sent="684",total-size="1936926"}
-> 13+download,{section=".text",section-size="109472",total-size="1936926"}
-> 13+download,{section=".rodata",section-size="5684",total-size="1936926"}
-> 13+download,{section=".ARM",section-size="8",total-size="1936926"}
-> 13+download,{section=".init_array",section-size="4",total-size="1936926"}
-> 13+download,{section=".fini_array",section-size="4",total-size="1936926"}
-> 13+download,{section=".data",section-size="596",total-size="1936926"}
-> 13^done,address="0x08010a28",load-size="116452",transfer-rate="1219392",write-rate="8957"
14-interpreter-exec console "monitor reset halt"
-> @"[stm32h7x.cpu0] halted due to debug-request, current mode: Thread \n"
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread
-> @"xPSR: 0x01000000 pc: 0x08010a28 msp: 0x24100000\n"
xPSR: 0x01000000 pc: 0x08010a28 msp: 0x24100000
-> 14^done
15-break-insert "/workspaces/hybrid-control-unit/eft-h1x-hcu/src/customers/rotax_controller.c:91"
-> ~"Note: automatically using hardware breakpoints for read-only addresses.\n"
Note: automatically using hardware breakpoints for read-only addresses.
-> 15^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0801aa94",func="rotax_controller",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/src/customers/rotax_controller.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/src/customers/rotax_controller.c",line="91",thread-groups=["i1"],times="0",original-location="/workspaces/hybrid-control-unit/eft-h1x-hcu/src/customers/rotax_controller.c:91"}
Returning dummy thread-id to workaround VSCode issue with pause button not working
Returning dummy thread-id to workaround VSCode issue with pause button not working
Returning dummy stack frame to workaround VSCode issue with pause button not working: {"threadId":1,"startFrame":0,"levels":20}
16-stack-list-frames --thread 1 0 0
-> 16^done,stack=[frame={level="0",addr="0x08010a28",func="Reset_Handler",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/startup_stm32h7a3xxq.s",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/startup_stm32h7a3xxq.s",line="61",arch="armv7e-m"}]
17-stack-list-frames --thread 1 0 19
-> 17^done,stack=[frame={level="0",addr="0x08010a28",func="Reset_Handler",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/startup_stm32h7a3xxq.s",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/startup_stm32h7a3xxq.s",line="61",arch="armv7e-m"}]
18-break-insert -t --function main
-> 18^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x0800fb84",func="main",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",thread-groups=["i1"],times="0",original-location="-function main"}
19-var-create --thread 1 --frame 0 hover_7a75c957b76689d3b6a0a85c8c658938ef2dc0b775bca777cfb982c515a1b9e3 @ "_tx_thread_created_ptr"
-> 19^error,msg="-var-create: unable to create variable object"
20-exec-continue --all
Info: Received evaluate request while busy. {"expression":"_tx_thread_created_ptr","frameId":4096,"context":"hover"}
-> 20^running
-> *running,thread-id="all"
mi2.status = running
-> =breakpoint-modified,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x0800fb84",func="main",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",thread-groups=["i1"],times="1",original-location="-function main"}
-> ~"\n"

-> ~"Temporary breakpoint 2, main () at /workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c:120\n"
Temporary breakpoint 2, main () at /workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c:120
-> ~"120\t    HAL_Init();\n"
120     HAL_Init();
-> *stopped,reason="breakpoint-hit",disp="del",bkptno="2",frame={addr="0x0800fb84",func="main",args=[],file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",arch="armv7e-m"},thread-id="1",stopped-threads="all"
mi2.status = stopped
-> =breakpoint-deleted,id="2"
21-var-create --thread 1 --frame 0 hover_a0caade21aee976e19237a7c24094af6def1d2acf887dea47c867fd543f48cc2 @ "pxReadyTasksLists"
-> 21^error,msg="-var-create: unable to create variable object"
hover -var-create: unable to create variable object (from var-create --thread 1 --frame 0 hover_a0caade21aee976e19237a7c24094af6def1d2acf887dea47c867fd543f48cc2 @ "pxReadyTasksLists")22-thread-list-ids
-> 22^done,thread-ids={thread-id="1"},current-thread-id="1",number-of-threads="1"
23-thread-list-ids
-> 23^done,thread-ids={thread-id="1"},current-thread-id="1",number-of-threads="1"
24-thread-info 1
-> 24^done,threads=[{id="1",target-id="Remote target",frame={level="0",addr="0x0800fb84",func="main",args=[],file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",arch="armv7e-m"},state="stopped"}]
25-thread-info 1
-> 25^done,threads=[{id="1",target-id="Remote target",frame={level="0",addr="0x0800fb84",func="main",args=[],file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",arch="armv7e-m"},state="stopped"}]
26-thread-list-ids
-> 26^done,thread-ids={thread-id="1"},current-thread-id="1",number-of-threads="1"
27-thread-info 1
-> 27^done,threads=[{id="1",target-id="Remote target",frame={level="0",addr="0x0800fb84",func="main",args=[],file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",arch="armv7e-m"},state="stopped"}]
28-stack-list-frames --thread 1 0 19
-> 28^done,stack=[frame={level="0",addr="0x0800fb84",func="main",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",arch="armv7e-m"}]
29-stack-list-frames --thread 1 0 0
-> 29^done,stack=[frame={level="0",addr="0x0800fb84",func="main",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",arch="armv7e-m"}]
30-stack-list-frames --thread 1 0 0
-> 30^done,stack=[frame={level="0",addr="0x0800fb84",func="main",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",arch="armv7e-m"}]
31-var-create --thread 1 --frame 0 hover_7a75c957b76689d3b6a0a85c8c658938ef2dc0b775bca777cfb982c515a1b9e3 @ "_tx_thread_created_ptr"
-> 31^error,msg="-var-create: unable to create variable object"
hover -var-create: unable to create variable object (from var-create --thread 1 --frame 0 hover_7a75c957b76689d3b6a0a85c8c658938ef2dc0b775bca777cfb982c515a1b9e3 @ "_tx_thread_created_ptr")32-var-create --thread 1 --frame 0 hover_3a036eb0c8fd1a02d65dd10c96ee568e6997b1105097f5efe0bf86d1c1fd3176 @ "_kernel_thread_info_offsets"
-> 32^error,msg="-var-create: unable to create variable object"
hover -var-create: unable to create variable object (from var-create --thread 1 --frame 0 hover_3a036eb0c8fd1a02d65dd10c96ee568e6997b1105097f5efe0bf86d1c1fd3176 @ "_kernel_thread_info_offsets")33-var-create --thread 1 --frame 0 watch_fa5f359780eba5863e4a0180977198cf47a027ad278acf68e62a664eea70df0f @ "O2_dac_data[0]"
-> 33^error,msg="-var-create: unable to create variable object"
watch -var-create: unable to create variable object (from var-create --thread 1 --frame 0 watch_fa5f359780eba5863e4a0180977198cf47a027ad278acf68e62a664eea70df0f @ "O2_dac_data[0]")34-var-create --thread 1 --frame 0 watch_885dc0e3b20f3cb56302e233f846016097318015556985d6de2bd1ab211794c3 @ "O2_dac_data[1]"
-> 34^error,msg="-var-create: unable to create variable object"
watch -var-create: unable to create variable object (from var-create --thread 1 --frame 0 watch_885dc0e3b20f3cb56302e233f846016097318015556985d6de2bd1ab211794c3 @ "O2_dac_data[1]")35-var-create --thread 1 --frame 0 watch_dd1c7dc7a36ebb5a804967480a7c97605feca1ff606fe0df05ddc9976e743d26 @ "O2_dac_data[2]"
-> 35^error,msg="-var-create: unable to create variable object"
watch -var-create: unable to create variable object (from var-create --thread 1 --frame 0 watch_dd1c7dc7a36ebb5a804967480a7c97605feca1ff606fe0df05ddc9976e743d26 @ "O2_dac_data[2]")36-var-create --thread 1 --frame 0 watch_11da499dbd2ac05b80c0e15f6c2ad2d0a14b4c0aa0aaaa9fba81fa3732f53619 @ "out_val"
-> 36^error,msg="-var-create: unable to create variable object"
watch -var-create: unable to create variable object (from var-create --thread 1 --frame 0 watch_11da499dbd2ac05b80c0e15f6c2ad2d0a14b4c0aa0aaaa9fba81fa3732f53619 @ "out_val")37-var-create --thread 1 --frame 0 hover_a0caade21aee976e19237a7c24094af6def1d2acf887dea47c867fd543f48cc2 @ "pxReadyTasksLists"
-> 37^error,msg="-var-create: unable to create variable object"
hover -var-create: unable to create variable object (from var-create --thread 1 --frame 0 hover_a0caade21aee976e19237a7c24094af6def1d2acf887dea47c867fd543f48cc2 @ "pxReadyTasksLists")38-var-create --thread 1 --frame 0 hover_88a8e759d0b575f6f113f5badafcf28ed3aeb200cbe075b3bf4af9a8ae216f56 @ "_track_list_k_mutex"
-> 38^error,msg="-var-create: unable to create variable object"
hover -var-create: unable to create variable object (from var-create --thread 1 --frame 0 hover_88a8e759d0b575f6f113f5badafcf28ed3aeb200cbe075b3bf4af9a8ae216f56 @ "_track_list_k_mutex")39-var-create --thread 1 --frame 0 hover_3a036eb0c8fd1a02d65dd10c96ee568e6997b1105097f5efe0bf86d1c1fd3176 @ "_kernel_thread_info_offsets"
-> 39^error,msg="-var-create: unable to create variable object"
hover -var-create: unable to create variable object (from var-create --thread 1 --frame 0 hover_3a036eb0c8fd1a02d65dd10c96ee568e6997b1105097f5efe0bf86d1c1fd3176 @ "_kernel_thread_info_offsets")40-var-create --thread 1 --frame 0 hover_88a8e759d0b575f6f113f5badafcf28ed3aeb200cbe075b3bf4af9a8ae216f56 @ "_track_list_k_mutex"
-> 40^error,msg="-var-create: unable to create variable object"
hover -var-create: unable to create variable object (from var-create --thread 1 --frame 0 hover_88a8e759d0b575f6f113f5badafcf28ed3aeb200cbe075b3bf4af9a8ae216f56 @ "_track_list_k_mutex")41-stack-info-frame --thread 1 --frame 0
-> 41^done,frame={level="0",addr="0x0800fb84",func="main",file="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",fullname="/workspaces/hybrid-control-unit/eft-h1x-hcu/stm32-lib/Core_v0-4-0/Src/main.c",line="120",arch="armv7e-m"}
42-stack-list-variables --thread 1 --frame 0 --simple-values
-> 42^done,variables=[]
43-var-create --thread 1 --frame 0 hover_f22a05b5213e928b72190291eb8249c9542a6b73250b63f7d7d5be972bc55d88 @ "Initialize"
-> 43^error,msg="-var-create: unable to create variable object"
hover -var-create: unable to create variable object (from var-create --thread 1 --frame 0 hover_f22a05b5213e928b72190291eb8249c9542a6b73250b63f7d7d5be972bc55d88 @ "Initialize")

Additional context I found following ticket which seems to be a similar / the same problem, but I couldnt find a solution for myself.

https://github.com/Marus/cortex-debug/issues/493

nojas15 commented 11 months ago

As already stated above the user within the devcontainer is my issue.

As stated above:

I use a user inside the devcontainer because I had issues with git when using root to commit everything. Therefore I have to use a start_openocd.sh script which starts openocd for me as sudo. Maybe this is the issue?

#!/bin/sh
sudo openocd "$@"

I rebuild the docker image with root and used the root user in the devcontainer and it worked out of the box.

Do you know of any way to start the openocd server within the devcontainer with sudo? I think you could close this issue, as I feel this is an issue how I have set it up. But I'm also happy if I get some feedback whats the best setup for a devcontainer on windows and debugging.

Thanks for all your great work! And sorry for bothering