unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Python's pdb module
@ 2021-04-30  3:26 Tim Meehan
  2021-04-30 11:42 ` Ricardo G. Herdt
  2021-04-30 13:20 ` Matt Wette
  0 siblings, 2 replies; 4+ messages in thread
From: Tim Meehan @ 2021-04-30  3:26 UTC (permalink / raw)
  To: guile-user

Is there something in Guile that is similar to Python's "pdb" module?
For instance, sometimes I find it helpful to pause right before something
bad happens with:

#!/usr/bin/env python3
import pdb; pdb.set_trace()
some_function_that_is_going_to_fail_miserably()


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Python's pdb module
  2021-04-30  3:26 Python's pdb module Tim Meehan
@ 2021-04-30 11:42 ` Ricardo G. Herdt
  2021-04-30 13:20 ` Matt Wette
  1 sibling, 0 replies; 4+ messages in thread
From: Ricardo G. Herdt @ 2021-04-30 11:42 UTC (permalink / raw)
  To: guile-user

Hi Tim,

Am 30.04.2021 05:26 schrieb Tim Meehan:
> Is there something in Guile that is similar to Python's "pdb" module?
> For instance, sometimes I find it helpful to pause right before 
> something
> bad happens with:

you can use the debugging features of the REPL. See:
,help debug

Example:
,break some-function-that-is-going-to-fail-miserably

Related to ,break is ,break-at-source, where you can give the line 
number where you want to stop.

You may also find ",trace" useful, it shows all calls to a given 
function.

Best,

Ricardo



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Python's pdb module
  2021-04-30  3:26 Python's pdb module Tim Meehan
  2021-04-30 11:42 ` Ricardo G. Herdt
@ 2021-04-30 13:20 ` Matt Wette
  2021-05-01  3:00   ` Tim Meehan
  1 sibling, 1 reply; 4+ messages in thread
From: Matt Wette @ 2021-04-30 13:20 UTC (permalink / raw)
  To: guile-user


On 4/29/21 8:26 PM, Tim Meehan wrote:
> Is there something in Guile that is similar to Python's "pdb" module?
> For instance, sometimes I find it helpful to pause right before something
> bad happens with:
>
> #!/usr/bin/env python3
> import pdb; pdb.set_trace()
> some_function_that_is_going_to_fail_miserably()

I started on something years ago but never got it working as nice as python,
as the guile debugger still needs some help to get there.   Try this 
snippet.

(define-syntax-rule (jump-to-debugger)
   (if (eqv? 'regular (vm-engine))
       (give-warning)
       (start-repl
        #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t))))

You'll need some of this mess to resolve procedures:

(use-modules (system repl repl))
(use-modules (system repl debug))
(use-modules (system repl common))
(use-modules (system repl command))
(use-modules (system vm frame))
(use-modules (system vm vm))
(use-modules (ice-9 control))
(use-modules (ice-9 rdelim))
(use-modules (ice-9 pretty-print))
(use-modules (system base compile))

Matt




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Python's pdb module
  2021-04-30 13:20 ` Matt Wette
@ 2021-05-01  3:00   ` Tim Meehan
  0 siblings, 0 replies; 4+ messages in thread
From: Tim Meehan @ 2021-05-01  3:00 UTC (permalink / raw)
  Cc: guile-user

Thanks for the ideas folks!

> On Apr 30, 2021, at 08:24, Matt Wette <matt.wette@gmail.com> wrote:
> 
> 
>> On 4/29/21 8:26 PM, Tim Meehan wrote:
>> Is there something in Guile that is similar to Python's "pdb" module?
>> For instance, sometimes I find it helpful to pause right before something
>> bad happens with:
>> 
>> #!/usr/bin/env python3
>> import pdb; pdb.set_trace()
>> some_function_that_is_going_to_fail_miserably()
> 
> I started on something years ago but never got it working as nice as python,
> as the guile debugger still needs some help to get there.   Try this snippet.
> 
> (define-syntax-rule (jump-to-debugger)
>   (if (eqv? 'regular (vm-engine))
>       (give-warning)
>       (start-repl
>        #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t))))
> 
> You'll need some of this mess to resolve procedures:
> 
> (use-modules (system repl repl))
> (use-modules (system repl debug))
> (use-modules (system repl common))
> (use-modules (system repl command))
> (use-modules (system vm frame))
> (use-modules (system vm vm))
> (use-modules (ice-9 control))
> (use-modules (ice-9 rdelim))
> (use-modules (ice-9 pretty-print))
> (use-modules (system base compile))
> 
> Matt
> 
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-01  3:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30  3:26 Python's pdb module Tim Meehan
2021-04-30 11:42 ` Ricardo G. Herdt
2021-04-30 13:20 ` Matt Wette
2021-05-01  3:00   ` Tim Meehan

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