Main Site Documentation

Changing variable values while debugging


#1

Hi everybody,

I’m trying to change variable values in my FEZ Panda II while debugging with VS 2010 Express.

I have a few variables I want to change on the fly without having to set a breakpoint and change the variables in the watch window. I was hoping I could do that with some kind of a GUI running parallel on my PC.

Thanks.


#2

The program needs to be paused if you want to change things. If you just want to set a variable based on something happening on your PC, then I’d suggest you use a serial connection to do it.


#3

Thanks MarkH.

The solution via RS232 would work. I would need a RS232 shield for that purpose since the Panda has only the UART level on board.

Is it possible to access publicly declared variables while debugging the console application from a second windows application ?


#4

Not really, there has to be a method on board to get a memory address. You would then need something on board to be able to set the memory address as well. There really isn’t an easy way to do something like that without writing a custom routine to read the request from the serial port and write the data automatically.

The debugger works by injecting breakpoints in the MSIL code, then unlocking the memory regions. Even then you can only see global variables and local ones, but ones that are out of scope are not visible or changable.


#5

By using serial i meant more along the lines of having serial communications to your dev board’s program - not the debugger. You’d use the SerialPort class on the pc and in your embedded code to send/receive commands that would set your variables.


#6

Thanks MarkH & Silic0re,

I have to go with the serial communication or get me a display. It still would be nice, if such a function could be implemented.
The emulater does not work with optimizing hardware like serial Servos which need optimizing a PID under different loads.


#7

Sorry for the late input.

@ kolibree, you can create a serial port over the USB wire, combined with the debug port. That way you don’t need extra hardware, you can tune you PID loop then remove the code to run only the debugger over usb…