Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] 3.07: debug information on camlp4-processed files is missing the file name?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] 3.07: debug information on camlp4-processed files is missing the file name?
On Monday, January 5, 2004, at 08:27 PM, Aleksey Nogin wrote:

> I noticed that in 3.07 the backtrace (OCAMLRUNPARAM=b) has empty file 
> names for the files was compiled with a camlp4 preprocessor. Since in 
> our project most of the files are camlp4-processed, this makes the 
> backtraces completely unusable :-(
>
> Is there some workaround for this (short of staying with 3.06)?

You can try this patch, developed by Artem Prysyznuk.  We haven't
incorporated it because we are doing extensive changes to camlp4
to deal correctly with new-style locations.  Please let me know
whether it works for you.

-- Damien

---------- begin patch file

diff -ru ocaml-3.07/camlp4/camlp4/argl.ml 
ocaml-3.07.tema/camlp4/camlp4/argl.ml
--- ocaml-3.07/camlp4/camlp4/argl.ml	2003-07-10 15:28:14.000000000 +0300
+++ ocaml-3.07.tema/camlp4/camlp4/argl.ml	2003-11-06 17:43:28.000000000 
+0200
@@ -397,11 +397,12 @@
            exit 2
          } ];
      try
-      if Pcaml.input_file.val <> "" then
+      if Pcaml.input_file.val <> "" then do {
+        Ast2pt.glob_fname.val := Pcaml.input_file.val;
          match file_kind.val with
          [ Intf -> process_intf ()
          | Impl -> process_impl () ]
-      else ()
+      } else ()
      with exc ->
        do {
          Format.set_formatter_out_channel stderr;
diff -ru ocaml-3.07/camlp4/camlp4/ast2pt.mli 
ocaml-3.07.tema/camlp4/camlp4/ast2pt.mli
--- ocaml-3.07/camlp4/camlp4/ast2pt.mli	2002-07-19 17:53:44.000000000 
+0300
+++ ocaml-3.07.tema/camlp4/camlp4/ast2pt.mli	2003-11-06 
17:43:28.000000000 +0200
@@ -12,6 +12,7 @@

  (* $Id: ast2pt.mli,v 1.3 2002/07/19 14:53:44 mauny Exp $ *)

+value glob_fname : ref string;
  value fast : ref bool;
  value no_constructors_arity : ref bool;
  value mkloc : (int * int) -> Location.t;

---------- end patch file

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