Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] debugging hints and camlp4 macros
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-06-11 (09:13)
From: Basile STARYNKEVITCH <basile.starynkevitch@c...>
Subject: [Caml-list] debugging hints and camlp4 macros
Dear All,

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

I am coding an ICAP server (ICAP = Internet Content Adaptation
Protocol, see 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

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

#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.


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 Archives:
Bug reports: FAQ:
Beginner's list: