caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Kerneis <kerneis@pps.jussieu.fr>
To: dumitru.potop@inria.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Smart caml editor and smart debugger
Date: Fri, 15 Oct 2010 12:21:27 +0200	[thread overview]
Message-ID: <20101015102127.GD27290@rhodium.pps.jussieu.fr> (raw)
In-Reply-To: <4CB8210D.7030307@inria.fr>

On Fri, Oct 15, 2010 at 11:38:21AM +0200, Dumitru Potop-Butucaru wrote:
>     Is there some tool allowing me, for instance,
>     to choose the functions whose calls I want to trace?
>     (so that the call and its parameters are
>     automatically logged).

In a toplevel, use the #trace directive:

# let rec f x = if x = 0 then 42 else f (x-1);;
value f : int -> int = <fun>
# #trace f;;
f is now traced.
# f 3 ;;
f <-- 3
f <-- 2
f <-- 1
f <-- 0
f --> 42
f --> 42
f --> 42
f --> 42
- : int = 42

Best,
-- 
Gabriel


  reply	other threads:[~2010-10-15 10:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15  9:38 Dumitru Potop-Butucaru
2010-10-15 10:21 ` Gabriel Kerneis [this message]
2010-10-15 10:59 ` [Caml-list] " Lukasz Stafiniak
2010-10-15 12:00 ` Vincent Aravantinos
2010-10-16 17:14   ` Yoann Padioleau
2010-10-16 10:23 ` Gaius Hammond

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101015102127.GD27290@rhodium.pps.jussieu.fr \
    --to=kerneis@pps.jussieu.fr \
    --cc=caml-list@inria.fr \
    --cc=dumitru.potop@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).