From 55bfff7cf6541caac172b43186cf14405185b14d Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 13 Apr 2019 12:40:52 -0400 Subject: fix curses on linux --- .../calculator/CEdev/examples/debugging/src/main.c | 94 +++++++++++----------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'frontends/calculator/CEdev/examples/debugging/src') diff --git a/frontends/calculator/CEdev/examples/debugging/src/main.c b/frontends/calculator/CEdev/examples/debugging/src/main.c index 67b5bac..0972efd 100644 --- a/frontends/calculator/CEdev/examples/debugging/src/main.c +++ b/frontends/calculator/CEdev/examples/debugging/src/main.c @@ -1,47 +1,47 @@ -#include -#include -#include -#include - -#include -#include - -/* - * Even though debug.h has prototypes for Debugger, SetWriteWatchpoint, SetWatchpoint, RemoveWatchpoint, RemoveAllWatchpoints, RemoveAllBreakpoints... - * you have to use the dbg_ prefix as shown here: - */ - -void main(void) { - /* Set the intial value of some variables */ - int dbg_test_var_1 = 10; - uint8_t dbg_test_var_2 = 3; - - /* Print a simple debugging string */ - dbg_sprintf(dbgout, "This is the start of a CEmu debugging test\n"); - - /* You can enter the debugger manually */ - dbg_Debugger(); - - /* Set a watchpoint that will break anytime we write/change this variable */ - dbg_SetWriteWatchpoint(&dbg_test_var_1, sizeof dbg_test_var_1); - - /* Set a non breaking watchpoint just so we can see what is in this variable at any given time */ - dbg_SetWatchpoint(&dbg_test_var_2, sizeof dbg_test_var_2); - - /* Now, let's write to the variable to see what happens (Go to the 'Watchpoints' tab in CEmu to view the status) */ - dbg_test_var_1 = 5; - - /* Remove the watchpoint that we had set */ - dbg_RemoveWatchpoint(&dbg_test_var_1); - dbg_RemoveWatchpoint(&dbg_test_var_2); - - /* We can also use those */ - dbg_RemoveAllWatchpoints(); - dbg_RemoveAllBreakpoints(); - - /* Set this value to zero */ - dbg_test_var_2 = 0; - - /* Fail this assertion */ - assert(dbg_test_var_2); -} +#include +#include +#include +#include + +#include +#include + +/* + * Even though debug.h has prototypes for Debugger, SetWriteWatchpoint, SetWatchpoint, RemoveWatchpoint, RemoveAllWatchpoints, RemoveAllBreakpoints... + * you have to use the dbg_ prefix as shown here: + */ + +void main(void) { + /* Set the intial value of some variables */ + int dbg_test_var_1 = 10; + uint8_t dbg_test_var_2 = 3; + + /* Print a simple debugging string */ + dbg_sprintf(dbgout, "This is the start of a CEmu debugging test\n"); + + /* You can enter the debugger manually */ + dbg_Debugger(); + + /* Set a watchpoint that will break anytime we write/change this variable */ + dbg_SetWriteWatchpoint(&dbg_test_var_1, sizeof dbg_test_var_1); + + /* Set a non breaking watchpoint just so we can see what is in this variable at any given time */ + dbg_SetWatchpoint(&dbg_test_var_2, sizeof dbg_test_var_2); + + /* Now, let's write to the variable to see what happens (Go to the 'Watchpoints' tab in CEmu to view the status) */ + dbg_test_var_1 = 5; + + /* Remove the watchpoint that we had set */ + dbg_RemoveWatchpoint(&dbg_test_var_1); + dbg_RemoveWatchpoint(&dbg_test_var_2); + + /* We can also use those */ + dbg_RemoveAllWatchpoints(); + dbg_RemoveAllBreakpoints(); + + /* Set this value to zero */ + dbg_test_var_2 = 0; + + /* Fail this assertion */ + assert(dbg_test_var_2); +} -- cgit v1.2.3-101-g0448