Changing Variable value in debug

I am trying to debug a esp32 One-Wire scanning C program on a ESP-Wrover-kit using JTAG. I have a global variable that holds the number of devices found on the bus (int DeviceCount). DeviceCount shows up in the watch window but I can not seem to change it’s value manually. When I right click on it I get the following options: {Add Expression, Copy Expression, Copy Value, Remove Expression and Remove All Expressions}. There is no Set Expression option. Does anyone have an idea what I am doing wrong?

Might sound dumb, but if you just click on the variable’s value, does it change to a textbox and allow you to change it? (Don’t have the VSCode debugger at hand at the moment)

No but, the program has a global array of structures variable that if I right click on any of the member variables I’m given the additional option ( Set Value). This allows the value change. This option doesn’t show on the DeviceCount Variable.

I FOUND A SOLUTION FOR CHANGING VARIABLE VALUES WHILE DEBUGGING ESP32 ON PLATFORMIO :sweat_smile: :grin: :heart_eyes: :upside_down_face: :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face:

You can SET VARIABLE VALUES IN WATCH WINDOW using expressions.
Example:

i=0

sets variable i to 0 every time you press play/continue button on debug screen. If you do not now to set i to 0 anymore, just delet this lite on watch window

See the attached picture below:

Mostrar menos

How to work with strings in Watch Window:

Example how to update with the string “Teste”:

tchar={‘T’,‘E’,‘s’,‘t’,‘e’}

It is not beautiful, but works, and you can fill with anything separated as bytes/chars. I hope it helps who are struggling with VSCode/Platformio debugging features.

See the image below: