$_TARGETNAME quoting?

Pasted by karlp on Fri Jan 19 09:25:32 2024 UTC as Text only
# In my openocd.cfg

proc app_rtos_restart { } {
        echo "restarting rtos awareness..."
        $_TARGETNAME configure -rtos none
        $_TARGETNAME configure -rtos FreeRTOS
}

# in GDB:
(gdb) mon $_TARGETNAME configure -rtos none
(gdb) mon $_TARGETNAME configure -rtos FreeRTOS
(gdb) mon app_rtos_restart
restarting rtos awareness...
invalid command name "$_TARGETNAME"
Protocol error with Rcmd
(gdb)