Browse thread
[Caml-list] debugging hints and camlp4 macros
- Basile STARYNKEVITCH
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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 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