gpgscm: Better error reporting.
authorJustus Winter <justus@g10code.com>
Fri, 18 Nov 2016 12:36:23 +0000 (13:36 +0100)
committerJustus Winter <justus@g10code.com>
Thu, 8 Dec 2016 16:22:50 +0000 (17:22 +0100)
commite7429b1ced0c69fa7901f888f8dc25f00fc346a4
treead455250ea1a3d6ff28436301e3c21f9a7eb0857
parent404e8a4136bbbab39df7dd5119841e131998cc15
gpgscm: Better error reporting.

* tests/gpgscm/ffi.scm: Move the customized exception handling and
atexit logic...
* tests/gpgscm/init.scm: ... here.
(throw): Record the current history.
(throw'): New function that is history-aware.
(rethrow): New function.
(*error-hook*): Use the new throw'.
* tests/gpgscm/main.c (load): Fix error handling.
(main): Save and use the 'sc->retcode' as exit code.
* tests/gpgscm/repl.scm (repl): Print call history.
* tests/gpgscm/scheme.c (_Error_1): Make a snapshot of the history,
use it to provide a accurate location of the expression causing the
error at runtime, and hand the history trace to the '*error-hook*'.
(opexe_5): Tag all lists at parse time with the current location.
* tests/gpgscm/tests.scm: Update calls to 'throw', use 'rethrow'.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/gpgscm/ffi.scm
tests/gpgscm/init.scm
tests/gpgscm/main.c
tests/gpgscm/repl.scm
tests/gpgscm/scheme.c
tests/gpgscm/tests.scm