guix-devel
[Top][All Lists]
Advanced

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

Re: Guile debugger workgroup?


From: zimoun
Subject: Re: Guile debugger workgroup?
Date: Mon, 28 Nov 2022 13:31:37 +0100

Hi,

On Mon, 28 Nov 2022 at 12:06, Ludovic Courtès <ludo@gnu.org> wrote:

> Why doesn’t it work in ‘guix repl’?  Because auto-compilation is
> disabled:

Ah, thanks.  Well, maybe we could have an option to start “guix repl”
with debug mode available… even if it is really slow.


> I think we should identify scenarios where things don’t work as
> expected, and then turn them into bug reports, documentation issues, or
> any other concrete action we should take.

The example I provided is, IMHO, a good scenario for starting. :-)  For
instance, ,step by ,step works,

--8<---------------cut here---------------start------------->8---
$ guix shell guile -- guile -q
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 "/tmp/my-target.scm")
scheme@(guile-user)> ,break example
Trap 0: Breakpoint at #<procedure example (x)>.
scheme@(guile-user)> (example #t)
Trap 0: Breakpoint at #<procedure example (x)>
Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In /tmp/my-target.scm:
     17:0  0 (example #t)
scheme@(guile-user) [1]> ,s
Step into #<frame 7ff70be4ace0 example>
scheme@(guile-user) [1]> ,bt
In /tmp/my-target.scm:
    19:21  0 (example _)
scheme@(guile-user) [1]> ,s
Step into #<frame 7ff70be73360 example>
scheme@(guile-user) [1]> ,s
Step into #<frame 7ff70beef870 example>
scheme@(guile-user) [1]> ,s
Step into #<frame 7ff70bf15f20 example>
scheme@(guile-user) [1]> ,bt
In /tmp/my-target.scm:
    19:20  1 (example _)
      3:0  0 (mutate-once "something")
scheme@(guile-user) [1]> 
--8<---------------cut here---------------end--------------->8---

but then I do not know how many steps are required to reach the other
’mutate-twice’.

--8<---------------cut here---------------start------------->8---
Step into #<frame 7ff70bf15350 mutate-once>
Step into #<frame 7ff70dab0480 mutate-once>
4x Step into #<frame 7ff70cc70760 b>
5x Step into #<frame 7ff70cc198e0 catch>
4x Step into #<frame 7ff70cc70170 catch>
Step into #<frame 7ff70c378bf0 procedure?>
10x Step into #<frame 7ff70c3784b0 catch>
4x Step into #<frame 7ff70bb33af0 with-exception-handler>
Step into #<frame 7ff70ba1adf0 procedure?>
6x Step into #<frame 7ff70ba1a6b0 with-exception-handler>
3x Step into #<frame 7ff70c32d060 make-prompt-tag>
5x Step into #<frame 7ff70da0e910 with-exception-handler>
Step into #<frame 7ff70b9921d0>
…
--8<---------------cut here---------------end--------------->8---

And I do not know if ,break-at-source works correctly.

--8<---------------cut here---------------start------------->8---
$ cat -n /tmp/my-target.scm | grep 20
    20           (my-target (mutate-twice my-target)))

$ guix shell guile -- guile -q
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 "/tmp/my-target.scm")
scheme@(guile-user)> ,break example
Trap 0: Breakpoint at #<procedure example (x)>.
scheme@(guile-user)> (example #t)
Trap 0: Breakpoint at #<procedure example (x)>
Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In /tmp/my-target.scm:
     17:0  0 (example #t)
scheme@(guile-user) [1]> ,break-at-source "/tmp/my-target.scm" 20
Trap 1: Breakpoint at /tmp/my-target.scm:20.
scheme@(guile-user) [1]> ,bt
In /tmp/my-target.scm:
     17:0  0 (example #t)
scheme@(guile-user) [1]> ,next
Step into #<frame 7f8c260a9b00 example>
scheme@(guile-user) [1]> ,bt
In /tmp/my-target.scm:
    19:21  0 (example _)
scheme@(guile-user) [1]> ,locals
  No local variables.
scheme@(guile-user) [1]>
--8<---------------cut here---------------end--------------->8---


Cheers,
simon



reply via email to

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