Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Unix.file_descr -> int ???
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mattias Waldau <mattias.waldau@a...>
Subject: Ocaml debugging (Was [Caml-list] Unix.file_descr -> int ???)
> I was trying to trace a code with some significant amount of 
> select'ed fds. At some point, I faced the fact that I just 
> have no way to "show" a descriptor value. That was a real 
> shock. At the moment, the bug is found and fixed deductively, 
> but the question remains.

This raises the issue with debugging in Ocaml and printing the
contents of variables.

ocamldebug is very good, and if you sprinkle your code with asserts, 
and use the backwards stepping function, you find almost all your
bugs within minutes.

However, this only works if you don't use signatures and objects.
Therefor, I do not use them! 

It would really be an improved to O'Caml if 
- Functions can be called in the debugger
- The signatures can be by-passed (so that you can see all
  elements in your Set)
- instance variables can be shown.

I know that you can define printers for the debugger, but currently
it is too clumsy. Why is this done by ocamlc (isn't it that what -g
means :-)?
(maybe is should be a camlp-filter, but it must be done automatically,
otherwise very few will use it.)

/mattias

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