[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stack traces
From: |
Matt Wette |
Subject: |
Re: Stack traces |
Date: |
Sat, 18 Feb 2017 08:58:58 -0800 |
> On Feb 18, 2017, at 7:53 AM, Amirouche <address@hidden> wrote:
> Le 18/02/2017 à 16:50, Amirouche a écrit :
>> Le 18/02/2017 à 01:13, Matt Wette a écrit :
>>> (use-modules (system repl repl))
>>> (use-modules (system repl debug))
>>>
>>> (define-syntax-rule (trap-here)
>>> (start-repl
>>> #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t)))
>>>
>>> (define (foo)
>>> (let iter ((sum 0) (vals '(1 2 3 5 8 2)))
>>> (trap-here)
>>> (if (null? vals) sum
>>> (iter (+ sum (car vals)) (cdr vals)))))
>>>
>>> (foo)
>> It looks like that. Except `iter` should be defined in the namespace of the
>> REPL.
> Maybe iter is complicated, but at least sum and vals.
Hmm. The procedure “foo” without the "(trap-here)” is just a simple program
(using named let) that I want to debug.
So I add the “(trap-here)” to get into the debugger at that spot in the
program, like I would add “pdb.set_trace()” in python.
Matt
- Re: guile-user Digest, Vol 171, Issue 14, Cecil McGregor, 2017/02/14
- Re: guile-user Digest, Vol 171, Issue 14, Christopher Allan Webber, 2017/02/14
- Re: guile-user Digest, Vol 171, Issue 14, Amirouche, 2017/02/14
- Stack traces, Ludovic Courtès, 2017/02/14
- Re: Stack traces, Christopher Allan Webber, 2017/02/15
- Re: Stack traces, Matt Wette, 2017/02/15
- Re: Stack traces, Matt Wette, 2017/02/17
- Re: Stack traces, Amirouche, 2017/02/18
- Re: Stack traces, Amirouche, 2017/02/18
- Re: Stack traces,
Matt Wette <=
- Re: Stack traces, Amirouche, 2017/02/18
- Re: Stack traces, Matt Wette, 2017/02/18
- Re: Stack traces, Andy Wingo, 2017/02/27
- Re: Stack traces, Amirouche, 2017/02/27