unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: guile-user@gnu.org
Subject: Re: jump-to-debugger (like Python's pdb.set_trace)
Date: Sat, 19 Mar 2022 12:16:14 -0700	[thread overview]
Message-ID: <ae80e495-c655-d6d7-9271-379e039abb2d@gmail.com> (raw)
In-Reply-To: <c68b5b17-d182-06c8-50fa-c0dfea2541b6@gmail.com>

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)>





      parent reply	other threads:[~2022-03-19 19:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13 20:47 jump-to-debugger (like Python's pdb.set_trace) Matt Wette
2022-03-14  3:36 ` Tim Meehan
2022-03-15  3:03 ` Maxim Cournoyer
2022-03-19 19:16 ` Matt Wette [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae80e495-c655-d6d7-9271-379e039abb2d@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).