Skip to content

Debugger Library submission request #7192

@jspayneco

Description

@jspayneco

I would like the library at location below for inclusion in the Arduino Libraries.
https://github.com/jspayneco/Debugger

Introducing the Arduino Debugger

Features:

Set, enable and disable breakpoints.
View watch variables.
Display memory.
No hardware to buy.
No application to install on your computer/PC.
Uses the Arduino IDE built-in Serial Monitor.

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

Arduino Debugger Forum

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions