caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile.starynkevitch@cea.fr>
To: caml-list@inria.fr
Subject: [Caml-list] debugging hints and camlp4 macros
Date: Tue, 11 Jun 2002 11:12:56 +0200	[thread overview]
Message-ID: <15621.48920.186835.87150@is002254.saclay.cea.fr> (raw)

Dear All,

Does anyone have debugging hints, particularily when coding a
server. (See on http://www2.poesia-filter.org:8000/ the CVS of
PoesiaSoft/PoesiaMonIcap - it is GPL-ed opensource code).

I am coding an ICAP server (ICAP = Internet Content Adaptation
Protocol, see www.i-cap.org is a textual protocol similar to HTTP in
spirit) .

I find the Ocaml debugger difficult to use (even under emacs). For
example, I cannot interactiveley interrupt the debugged program. And
the debugger does not reload automatically the program after a
recompilation.

I am using Printf.eprintf to debug. But I would like to add a more
parameterable debugging code.

Does anyone have any hints or Camlp4 code for that. In particular, I
am missing the equivalent of (in C, using Gnu GCC preprocessor
extensions)

#define dbgprintf(Fmt, Args...)  printf("@@ " __FILE__ ":%d: " Fmt "\n", __LINE__, ##Args)

or even


#define dbgprintf(Fmt, Args...) {if (qish_debug) \
  printf("%s:%d@%s!! " Fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##Args);}

a macro used like

  dbgprintf("here i=%d", i);


BTW, a feature I am missing in Camlp4 (and I do thanks Daniel de
Rauglaudre for his Camlp4) is to mix preprocessOR and preprocessED
source code in the same file.

Regards.

N.B. Any opinions expressed here are only mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.

---------------------------------------------------------------------
Basile STARYNKEVITCH   ----  Commissariat à l Energie Atomique * France
DRT/LIST/DTSI/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX 
phone:+33 1,6908.6055; fax: 1,6908.8395 home: 1,4665.4553; mobile: 6,8501.2359
work email: Basile point Starynkevitch at cea point fr 
home email: Basile at Starynkevitch point net

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


             reply	other threads:[~2002-06-11  9:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-11  9:12 Basile STARYNKEVITCH [this message]
2002-06-13  6:58 ` Daniel de Rauglaudre

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=15621.48920.186835.87150@is002254.saclay.cea.fr \
    --to=basile.starynkevitch@cea.fr \
    --cc=caml-list@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).