Introducing the Arduino Debugger


Features:



Arduino Debugger Forum


How to setup:


Install the “debugger” library using the Debugger.zip

Now utilize the library as you would any other Arduino library.


Add data watches using the WATCH(); statement in your code.


Example:


int counter = 0;

iWATCH(counter); //adds “counter” to variables displayable via the debugger.

cWATCH(myString); //add “myString” watch data

dWATCH(data); //add “data” to watch data




Add breakpoints using the BREAK(); statement in your code.


Example:


BREAK(2); //a breakpoint with an ID of “2”.





Using the Serial Monitor

  1. In the Serial Monitor, select the option “newline” at the bottom on the Monitor.

  2. The default baud rate is 9600.

  3. Type commands at the top of the monitor and then select send.








The command set


h” displays the help text.


dm [address (l len)] -> "dm 300" (displays memory contents.)

bp [break point ID] -> "bp 3" (activates breakpoint(s) with ID of 3)

cb -> "cb" (clear breakpoint(s))

go -> "go" (continues program execution)

st -> "st" (stop program execution)

dv [(repeat in ms)] -> "dv" (display variables)




dm” shows memory contents in HEX and ASCII


ff 00 02 00 28 01 17 01 00 00 20 00 00 00 00 00 ....(..... .....

00 00 00 00 ff 01 66 01 ff 01 44 02 ff 01 ff 01 ....⸮.....D.....




dv” displays list of variables:


[variable name][(location in memory)] = contents of variable

counter(@0x15e) = 23846




Advanced setup


To expand the number of data watches possible (defaults to 8) add the following before the <debugger.h> statement:


#define MAX_WATCHES 12


To increase the maximum breakpoints you can have add the following before the <debugger.h> statement:



#define MAX_BREAKPOINTS 8