From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA05340; Tue, 11 Jun 2002 11:13:46 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA05285 for ; Tue, 11 Jun 2002 11:13:45 +0200 (MET DST) Received: from cirse.saclay.cea.fr (cirse.saclay.cea.fr [132.166.192.127]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g5B9DiH28996 for ; Tue, 11 Jun 2002 11:13:44 +0200 (MET DST) Received: from argiope.saclay.cea.fr (argiope.saclay.cea.fr [132.166.192.108]) by cirse.saclay.cea.fr (8.12.2/8.12.2/CEAnet-Internet.1.0) with ESMTP id g5B9F8Pl011964 for ; Tue, 11 Jun 2002 11:15:08 +0200 (MEST) Received: from muguet.saclay.cea.fr (unverified) by argiope.saclay.cea.fr (Content Technologies SMTPRS 4.2.10) with ESMTP id for ; Tue, 11 Jun 2002 11:07:44 +0200 Received: from is002254.saclay.cea.fr (is002254.saclay.cea.fr [132.166.134.67]) by muguet.saclay.cea.fr (8.12.2/8.12.2/CEAnet-Interne.1.0) with ESMTP id g5B9DfCf006465; Tue, 11 Jun 2002 11:13:41 +0200 (MEST) Received: from basile by is002254.saclay.cea.fr with local (Exim 3.35 #1 (Debian)) id 17Hhhx-00027e-00; Tue, 11 Jun 2002 11:12:57 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <15621.48920.186835.87150@is002254.saclay.cea.fr> Date: Tue, 11 Jun 2002 11:12:56 +0200 To: caml-list@inria.fr Subject: [Caml-list] debugging hints and camlp4 macros X-Mailer: VM 7.03 under Emacs 21.2.1 From: Basile STARYNKEVITCH Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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