When executing the
guile command, Guile exceptions
uncaught within the Guile code are translated to calls to the
gdb error-reporting mechanism. If the command that called
guile does not handle the error, gdb will
terminate it and report the error according to the setting of
guile print-stack parameter.
guile print-stack parameter has three settings:
(gdb) guile (display foo) ERROR: In procedure memoize-variable-access!: ERROR: Unbound variable: foo Error while executing Scheme code.
(gdb) set guile print-stack full (gdb) guile (display foo) Guile Backtrace: In ice-9/boot-9.scm: 157: 10 [catch #t #<catch-closure 2c76e20> ...] In unknown file: ?: 9 [apply-smob/1 #<catch-closure 2c76e20>] In ice-9/boot-9.scm: 157: 8 [catch #t #<catch-closure 2c76d20> ...] In unknown file: ?: 7 [apply-smob/1 #<catch-closure 2c76d20>] ?: 6 [call-with-input-string "(display foo)" ...] In ice-9/boot-9.scm: 2320: 5 [save-module-excursion #<procedure 2c2dc30 ... ()>] In ice-9/eval-string.scm: 44: 4 [read-and-eval #<input: string 27cb410> #:lang ...] 37: 3 [lp (display foo)] In ice-9/eval.scm: 387: 2 [eval # ()] 393: 1 [eval #<memoized foo> ()] In unknown file: ?: 0 [memoize-variable-access! #<memoized foo> ...] ERROR: In procedure memoize-variable-access!: ERROR: Unbound variable: foo Error while executing Scheme code.
gdb errors that happen in gdb commands invoked by Guile code are converted to Guile exceptions. The type of the Guile exception depends on the error.
Guile procedures provided by gdb can throw the standard
Guile exceptions like
User interrupt (via C-c or by typing q at a pagination
prompt) is translated to a Guile
signal exception with value
gdb Guile procedures can also throw these exceptions:
<gdb:breakpoint>object becomes invalid if the user deletes it from the command line. The object still exists in Guile, but the object it represents is gone. Further operations on this breakpoint will throw this exception.
The following exception-related procedures are provided by the
<gdb:exception>object given by its key and args, which are the standard Guile parameters of an exception. See the Guile documentation for more information (see Exceptions).
#tif object is a
<gdb:exception>object. Otherwise return