summaryrefslogtreecommitdiff
path: root/packages/libndsfpc/examples/debugging/exceptionTest/exceptionTest.pp
diff options
context:
space:
mode:
authorLegolas <Legolas@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-05-31 12:15:24 +0000
committerLegolas <Legolas@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-05-31 12:15:24 +0000
commitf803d950d1e95ecefe2fbe8fac65331ddfbd264c (patch)
tree69273c288fa395af5b38ab6aab26b61ae95fa9b2 /packages/libndsfpc/examples/debugging/exceptionTest/exceptionTest.pp
parente4116efa7a366ee63355627bcdff3974fc6e4628 (diff)
downloadfpc-f803d950d1e95ecefe2fbe8fac65331ddfbd264c.tar.gz
* updated nds/gba linker scripts and reverted some changes for 2.2.4a release
- Removed unused/outdated stuff from libndsfpc + Added new examples for libndsfpc + Added working (I hope so...) makefile.fpc for all libndsfpc/libgbafpc examples git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13217 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/libndsfpc/examples/debugging/exceptionTest/exceptionTest.pp')
-rw-r--r--packages/libndsfpc/examples/debugging/exceptionTest/exceptionTest.pp25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/libndsfpc/examples/debugging/exceptionTest/exceptionTest.pp b/packages/libndsfpc/examples/debugging/exceptionTest/exceptionTest.pp
new file mode 100644
index 0000000000..086a1c6307
--- /dev/null
+++ b/packages/libndsfpc/examples/debugging/exceptionTest/exceptionTest.pp
@@ -0,0 +1,25 @@
+program main;
+
+{$apptype arm9}
+{$mode objfpc}
+
+uses
+ ctypes, nds9;
+
+// The default exception handler displays the exception type - data abort or undefined instruction
+// you can relate the exception to your code using arm-eabi-addr2line -e <elf file> <address>
+// assuming you built with debug info this will display a source file and a line number
+// The address of the instruction is shown as pc, beside the address which faulted
+// the rest of the screen is a dump of the registers.
+
+begin
+ // install the default exception handler
+ defaultExceptionHandler();
+
+ // generate an exception
+ pu32(250)^ := 100;
+
+ while true do
+ swiWaitForVBlank();
+
+end.