/packages/libndsfpc/examples/debugging/exceptionTest/exceptionTest.pp
Puppet | 24 lines | 17 code | 7 blank | 0 comment | 1 complexity | c3f25609653d793479363f415542d5f4 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
1program exceptionTest; 2 3{$mode objfpc} 4 5uses 6 ctypes, nds9; 7 8// The default exception handler displays the exception type - data abort or undefined instruction 9// you can relate the exception to your code using arm-eabi-addr2line -e <elf file> <address> 10// assuming you built with debug info this will display a source file and a line number 11// The address of the instruction is shown as pc, beside the address which faulted 12// the rest of the screen is a dump of the registers. 13 14begin 15 // install the default exception handler 16 defaultExceptionHandler(); 17 18 // generate an exception 19 pu32(8192)^ := 100; 20 21 while true do 22 swiWaitForVBlank(); 23 24end.