guile-user
[Top][All Lists]
Advanced

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

Re: Entering the interactive debugger


From: Taylan Ulrich Bayirli/Kammer
Subject: Re: Entering the interactive debugger
Date: Tue, 02 Sep 2014 22:14:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

"Thompson, David" <address@hidden> writes:

> On Tue, Sep 2, 2014 at 3:03 PM, Carlos Pita <address@hidden> wrote:
>> Hi all, although I have some experience with lisps, I'm still new to
>> guile and I'm having some trouble figuring out how to invoke the
>> interactive debugger at some arbitrary point in my code. Something like:
>>
>>         ; code here
>>         (debug)
>>         ; more code here
>>
>> The closer solution I could find in the manual is:
>>
>>         add-trap-at-source-location! file user-line
>>
>> Any suggestion?
>
> I don't know of any straightforward solution, but I would also like
> such a feature.  I don't think it would be too difficult to write a
> 'debug' procedure using the 'debug-trap-handler' procedure in (system
> repl error-handling) as inspiration.  Basically, you'd need to capture
> the current stack and spawn a new REPL in debug mode that uses that
> stack.

Couldn't you just use (error)?  It will enter the debugger if run from
the REPL or otherwise when debugging is enabled on the VM or so (I don't
know the details), though it will abort if run stand-alone; not sure if
that's enough for your purposes.

Taylan



reply via email to

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