* in-line trap ?
@ 2016-12-28 17:02 Matt Wette
2017-01-03 10:15 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Matt Wette @ 2016-12-28 17:02 UTC (permalink / raw)
To: guile-user
I have been going through the debugging infrastructure and can’t figure out how to code in a trap. I would like something like
(define (xxx) … (if cond (trap-here)) ….)
that would dump me into the interactive debugger when I hit that condition. Any help on achieving this is will be appreciated.
I use this a lot in python:
#!/usr/bin/python
import pdb
def xxx:
…
if cond:
pdb.set_trace()
….
Matt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: in-line trap ?
2016-12-28 17:02 in-line trap ? Matt Wette
@ 2017-01-03 10:15 ` Ludovic Courtès
2017-01-05 1:02 ` Matt Wette
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2017-01-03 10:15 UTC (permalink / raw)
To: guile-user
Hello!
Matt Wette <matt.wette@gmail.com> skribis:
> I have been going through the debugging infrastructure and can’t figure out how to code in a trap. I would like something like
>
> (define (xxx) … (if cond (trap-here)) ….)
>
> that would dump me into the interactive debugger when I hit that condition. Any help on achieving this is will be appreciated.
Something along these lines on 2.0:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(system repl repl)
scheme@(guile-user)> ,use(system repl debug)
scheme@(guile-user)> (start-repl #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t))
scheme@(guile-user) [1]>
--8<---------------cut here---------------end--------------->8---
In 2.1, ‘make-debug’ does not take this last #t argument.
HTH!
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: in-line trap ?
2017-01-03 10:15 ` Ludovic Courtès
@ 2017-01-05 1:02 ` Matt Wette
0 siblings, 0 replies; 3+ messages in thread
From: Matt Wette @ 2017-01-05 1:02 UTC (permalink / raw)
To: guile-user
> On Jan 3, 2017, at 2:15 AM, Ludovic Courtès <ludo@gnu.org> wrote:
>
> Hello!
>
> Matt Wette <matt.wette@gmail.com> skribis:
>
>> I have been going through the debugging infrastructure and can’t figure out how to code in a trap. I would like something like
>>
>> (define (xxx) … (if cond (trap-here)) ….)
>>
>> that would dump me into the interactive debugger when I hit that condition. Any help on achieving this is will be appreciated.
>
> Something along these lines on 2.0:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> ,use(system repl repl)
> scheme@(guile-user)> ,use(system repl debug)
> scheme@(guile-user)> (start-repl #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t))
> scheme@(guile-user) [1]>
> --8<---------------cut here---------------end--------------->8---
>
> In 2.1, ‘make-debug’ does not take this last #t argument.
Thanks for the lead. Though this does not seem to be working, I will try to use this as a starter after I finish my current task (on nyacc).
Matt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-05 1:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-28 17:02 in-line trap ? Matt Wette
2017-01-03 10:15 ` Ludovic Courtès
2017-01-05 1:02 ` Matt Wette
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).