guile-user
[Top][All Lists]
Advanced

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

Re: jump-to-debugger (like Python's pdb.set_trace)


From: Matt Wette
Subject: Re: jump-to-debugger (like Python's pdb.set_trace)
Date: Sat, 19 Mar 2022 12:16:14 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 3/13/22 1:47 PM, Matt Wette wrote:
Hi All,

I've put my "jump to debugger" code on github:
https://github.com/mwette/guile-jtd

jump-to-debugger is a procedure that, when called,
stops execution and fires up a REPL.  It is much like
Python's pdb.set_trace() function.


Hi All,

I've pushed version v220319a to my github repo.
1) Now requires --debug flag to script session:
    on-the-fly switching to debug vm is not reliable
2) added ,set-local! command
3) misc cleanup

Also, I believe I found the bug that was making line stepping swing back.
In guile-3.0.8, I changed line 913 of language/tree-il/compile-bytecode.scm
from
  (maybe-emit-source src)
to
  ;;(maybe-emit-source src)
That is, comment the line out.

Remember, this is all still experimental.

Regards,
Matt


mwette$ guile
GNU Guile 3.0.8
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (load "foo.scm")
scheme@(guile-user)> (foo)
foo.scm: line 7
        (if (< c 4)
*           (jump-to-debugger))
        (simple-format #t "foo a= ~S\n" (*a*))
scheme@(guile-user) [1]> ,next-line
foo.scm: line 8
            (jump-to-debugger))
*       (simple-format #t "foo a= ~S\n" (*a*))
        (simple-format #t "foo b= ~S\n" b)
scheme@(guile-user) [1]> ,locals
  Local variables:
  $1 = closure = #<procedure foo args>
  $2 = args = ()
  $3 = b = 1
  $4 = c = 3
scheme@(guile-user) [1]> ,set-local! b 2
Setting b from 1 to 2
scheme@(guile-user) [1]> ,locals
  Local variables:
  $5 = closure = #<procedure foo args>
  $6 = args = ()
  $7 = b = 2
  $8 = c = 3
scheme@(guile-user) [1]> ,next-line
foo a= 0
foo.scm: line 9
        (simple-format #t "foo a= ~S\n" (*a*))
*       (simple-format #t "foo b= ~S\n" b)
        (simple-format #t "foo c= ~S\n" c)))
scheme@(guile-user) [1]> ,next-line
foo b= 2
foo.scm: line 10
        (simple-format #t "foo b= ~S\n" b)
*       (simple-format #t "foo c= ~S\n" c)))
  #<eof>
scheme@(guile-user) [1]> ,q
foo c= 3
scheme@(guile-user)>





reply via email to

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