libc8
CHIP-8 utility library
debug.h
Go to the documentation of this file.
1
8#ifndef LIBC8_DEBUG_H
9#define LIBC8_DEBUG_H
10
11#include "../chip8.h"
12
13#define DEBUG_QUIT 1
14#define DEBUG_CONTINUE 2
15#define DEBUG_STEP 3
16
17#define DEBUG_HELP_STRING "Available commands:\n\
18break [ADDRESS]: Add breakpoint to PC or ADDRESS, if given\n\
19rmbreak [ADDRESS]: Remove breakpoint at PC or ADDRESS, if given\n\
20continue: Exit debug mode until next breakpoint or completion\n\
21help: Print this help string\n\
22load PATH: Load program state from PATH\n\
23next: Step to the next instruction\n\
24print [ATTRIBUTE]: Print current value of ATTRIBUTE\n\
25save PATH: Save program state to the given file\n\
26set ATTRIBUTE VALUE: Set the given attribute to the given value\n\
27quit: Terminate the program\n\
28\n\
29Available attributes to print:\n\
30PC: Program counter\n\
31SP: Stack pointer\n\
32DT: Delay timer\n\
33ST: Sound timer\n\
34I: I address\n\
35K: Register to store next keypress\n\
36V[x]: All register values or value of Vx, if given\n\
37stack: All stack values\n\
38$[address]: Value at given address\n\
39\n\
40If no argument is given to print, it will print all of the above attributes\n\
41except for address values.\n"
42
43
44int debug_repl(c8_t *);
45int has_breakpoint(c8_t *, uint16_t);
46
47#endif
int debug_repl(c8_t *)
Debug command line loop.
Definition: debug.c:174
int has_breakpoint(c8_t *, uint16_t)
Check if breakpoint exists at address pc.
Definition: debug.c:225
Represents current state of the CHIP-8 interpreter.
Definition: chip8.h:51