guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile-debugging: how to access source properties from trap context


From: Neil Jerram
Subject: Re: guile-debugging: how to access source properties from trap context
Date: Mon, 02 Jan 2006 12:39:55 +0000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Neil Jerram <address@hidden> writes:

> It sounds like what you might in fact want is a report of the
> evaluation of each subexpression within mkmatrix.  In that case, the
> correct incantation would be something like this:

[complex incantations suppressed]

It occurred to me later that I should also point out a much simpler
option.  If you are just looking for something analogous to the GDB
example that you gave, you can get this much more easily as the
following session trace shows.

address@hidden:~$ /usr/bin/guile -q
guile> (use-modules (ice-9 debugger) (ossau ice-9-debugger-extensions) (ossau 
breakpoints))
guile> (load "matrix.scm")
guile> (break-in 'mkmatrix #:behaviour debug-trap)
#<<break-in> 808cb70>
guile> (do-main 4)
This is the Guile debugger -- for help, type `help'.
There are 3 frames on the stack.

Frame 2:    [mkmatrix]
debug> next
Frame 3:    (let ((x 1)) (quote this-is-a-matric))
debug> info frame
Stack frame: 3
This frame is an evaluation.
The expression being evaluated is:
matrix.scm:3:3:
  (let ((x 1)) (quote this-is-a-matric))
debug> next
Frame 3:    (quote this-is-a-matric)
debug> bt
In unknown file:
   ?: 0* [primitive-eval (do-main 4)]
In standard input:
   5: 1* [do-main 4]
In matrix.scm:
   7: 2  [mkmatrix]
   ...
   4: 3  (quote this-is-a-matric)
debug> 

Or you can use the Emacs interface (GDS), by using (ossau gds-client)
instead of (ice-9 debugger) and (ossau ice-9-debugger-extensions), and
changing debug-trap to gds-debug-trap.

Hope this helps,

     Neil







reply via email to

[Prev in Thread] Current Thread [Next in Thread]