When debugging a remote embedded device (in this case, an STM32F100 via OpenOCD w/JTAG)... there will be no value available in the hover text. When hovering, this message is displayed in the debug window:
C evaluate: {"expression":"UI_UPDATE_INTERVAL_MS","frameId":1000,"context":"hover"}
1: (3898466) <-1716-var-create - * "UI_UPDATE_INTERVAL_MS"
1: (3898472) ->1716^error,msg="-var-create: unable to create variable object"
1: (3898472) ->(gdb)
1: (3898472) 1716: elapsed time 6
R: {"success":false,"message":"Evaluation error","request_seq":390,"command":"evaluate","body":{"error":{"id":1101,"format":"Evaluation error","variables":null}},"running":false,"refs":null,"seq":0,"type":"response"}
to see, this line included in launch.json :
"logging": { "trace": true, "traceResponse": true, "engineLogging": true }
if needed, more details on my setup can be found in issue #706
The problem seems to be specific to values created with #Define and is perhaps more of a feature request to show the #Define values in hover text - and perhaps even indicate they are not variables.
In the attached picture, I am hovering over the UI_UPDATE_INTERVAL_MS text at the breakpoint.
The debugger doesn't have access to macro values, and the VS debugger behaves the same way. The workaround is to use the peek definition feature to see the value of the #define or to change your code to assign the macro to a variable and inspect the variable value.
@gojimmypi If gdb can't resolve -var-create - * "UI_UPDATE_INTERVAL_MS", then this isn't something we can fix. We don't have a way to query the language service from the debugger to get the value of your #define
Same problem here for non-macro cases.
Me too. `"-var-create: unable to create variable object" is always shown, regardless of the action taken.
It means I cannot catch throw in the gdb console.
This issue has been closed automatically because it's labeled as 'external'.
Most helpful comment
Me too. `"-var-create: unable to create variable object" is always shown, regardless of the action taken.
It means I cannot
catch throwin the gdb console.