guile-user
[Top][All Lists]
Advanced

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

Re: trace-calls-to-procedure


From: Tim Van den Langenbergh
Subject: Re: trace-calls-to-procedure
Date: Fri, 25 Dec 2020 13:37:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 25/12/2020 05:51, Tim Meehan wrote:
I have used ",trace" before and get what it is supposed to do, but I am not
sure what "trace-calls-to-procedure" is supposed to do ...

;; Using Guile 3.0.4
(use-modules (system vm trace))

(define (sqr x)
     (* x x))

(trace-calls-to-procedure sqr)

(sqr 3)

;; ... and nothing happens ... is something supposed to happen?


trace-calls-to-procedure is a low-level trace procedure that returns a trap that you have to install in the trap state. You can either use the add-trap! procedure from (use-modules system vm trap-state), or use the add-trace-at-procedure-call! procedure from the same module.

That said, there seems to be a bug in add-trace-at-procedure-call! which I'm having a hard time figuring out... c'est la vie.

Vale
-Tim Van den Langenbergh

Attachment: OpenPGP_0xF50AF328D9D1E635.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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