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 --- .../CEdev/examples/debugging/bin/DEMO.map | 70 ++++++++-------- .../calculator/CEdev/examples/debugging/makefile | 36 ++++----- .../calculator/CEdev/examples/debugging/readme.md | 20 ++--- .../calculator/CEdev/examples/debugging/src/main.c | 94 +++++++++++----------- 4 files changed, 110 insertions(+), 110 deletions(-) (limited to 'frontends/calculator/CEdev/examples/debugging') diff --git a/frontends/calculator/CEdev/examples/debugging/bin/DEMO.map b/frontends/calculator/CEdev/examples/debugging/bin/DEMO.map index 4462134..ec5a9cf 100644 --- a/frontends/calculator/CEdev/examples/debugging/bin/DEMO.map +++ b/frontends/calculator/CEdev/examples/debugging/bin/DEMO.map @@ -1,35 +1,35 @@ -Segment Base Top High Length --------- ------ ------ ------ ------- -icon D1A882 D1A882 0h -launcher D1A882 D1A882 0h -libs D1A882 D1A882 0h -startup D1A882 D1A8C1 3Fh -cleanup D1A8C1 D1A8D5 14h -exit D1A8D5 D1A8DB 6h -code D1A8DB D1A9D6 FBh -data D1A9D6 D1A9D6 0h -strsect D1A9D6 D1AA7B A5h -text D1AA7B D1AA7B 0h -bss D031F6 D031F6 D13FD6 0h -header D1A87F D1A882 3h - -Label Value -------------------------- ------ -_os_DisableHomeTextBuffer = D1A8DB -_os_EnableHomeTextBuffer = D1A8ED -_dbg_Debugger = D1A8FF -_dbg_RemoveAllBreakpoints = D1A905 -_dbg_RemoveWatchpoint = D1A90B -_dbg_SetWatchpoint = D1A915 -_dbg_RemoveAllWatchpoints = D1A921 -_dbg_SetWriteWatchpoint = D1A927 -_abort = D1A933 -_sprintf = 0000BC -__ccleanup = D1A8C1 -_errno = D008DC -_init = D1A882 -_exit = D1A8D7 -__exit = D1A8B0 -__exitsp = D1A8B0 -__errsp = D1A8B0 -_main = D1A93C +Segment Base Top High Length +-------- ------ ------ ------ ------- +icon D1A882 D1A882 0h +launcher D1A882 D1A882 0h +libs D1A882 D1A882 0h +startup D1A882 D1A8C1 3Fh +cleanup D1A8C1 D1A8D5 14h +exit D1A8D5 D1A8DB 6h +code D1A8DB D1A9D6 FBh +data D1A9D6 D1A9D6 0h +strsect D1A9D6 D1AA7B A5h +text D1AA7B D1AA7B 0h +bss D031F6 D031F6 D13FD6 0h +header D1A87F D1A882 3h + +Label Value +------------------------- ------ +_os_DisableHomeTextBuffer = D1A8DB +_os_EnableHomeTextBuffer = D1A8ED +_dbg_Debugger = D1A8FF +_dbg_RemoveAllBreakpoints = D1A905 +_dbg_RemoveWatchpoint = D1A90B +_dbg_SetWatchpoint = D1A915 +_dbg_RemoveAllWatchpoints = D1A921 +_dbg_SetWriteWatchpoint = D1A927 +_abort = D1A933 +_sprintf = 0000BC +__ccleanup = D1A8C1 +_errno = D008DC +_init = D1A882 +_exit = D1A8D7 +__exit = D1A8B0 +__exitsp = D1A8B0 +__errsp = D1A8B0 +_main = D1A93C diff --git a/frontends/calculator/CEdev/examples/debugging/makefile b/frontends/calculator/CEdev/examples/debugging/makefile index 3ea542a..8617bbc 100644 --- a/frontends/calculator/CEdev/examples/debugging/makefile +++ b/frontends/calculator/CEdev/examples/debugging/makefile @@ -1,18 +1,18 @@ -# ---------------------------- -# Set NAME to the program name -# Set ICON to the png icon file name -# Set DESCRIPTION to display within a compatible shell -# Set COMPRESSED to "YES" to create a compressed program -# ---------------------------- - -NAME ?= DEMO -COMPRESSED ?= NO -ICON ?= iconc.png -DESCRIPTION ?= "C SDK Demo" - -# ---------------------------- - -# This is just so the main makefile in $CEDEV/examples makes this one be like "make debug" -.DEFAULT_GOAL := debug - -include $(CEDEV)/include/.makefile +# ---------------------------- +# Set NAME to the program name +# Set ICON to the png icon file name +# Set DESCRIPTION to display within a compatible shell +# Set COMPRESSED to "YES" to create a compressed program +# ---------------------------- + +NAME ?= DEMO +COMPRESSED ?= NO +ICON ?= iconc.png +DESCRIPTION ?= "C SDK Demo" + +# ---------------------------- + +# This is just so the main makefile in $CEDEV/examples makes this one be like "make debug" +.DEFAULT_GOAL := debug + +include $(CEDEV)/include/.makefile diff --git a/frontends/calculator/CEdev/examples/debugging/readme.md b/frontends/calculator/CEdev/examples/debugging/readme.md index 9d95f90..47c916a 100644 --- a/frontends/calculator/CEdev/examples/debugging/readme.md +++ b/frontends/calculator/CEdev/examples/debugging/readme.md @@ -1,10 +1,10 @@ -### Debugging Demo - -This demo demonstrates how to use a few of the debugging features implemented in CEmu - -![Screenshot](screenshot.png) - ---- - -This demo is a part of the C SDK Toolchain for use on the CE. - +### Debugging Demo + +This demo demonstrates how to use a few of the debugging features implemented in CEmu + +![Screenshot](screenshot.png) + +--- + +This demo is a part of the C SDK Toolchain for use on the CE. + 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