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
Ocaml debugger under Windows
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-06 (18:22)
From: Dmitry Bely <dmitry.bely@g...>
Subject: Re: [Caml-list] Ocaml debugger under Windows
On Feb 6, 2008 8:12 PM, Xavier Leroy <> wrote:
> Hello Dmitry,
> I'm delighted to see your attempts at getting ocamldebug to work under
> Windows.
> Generally speaking, the Windows port is the part of OCaml where we
> most desperately need outside help, as (1) it consumes quite a bit of
> my very limited time, (2) it's a cost center for the Caml development
> team (none of us uses Windows for our research activities), and (3)
> none of us is competent with Win32 programming.
> (For example, if anyone could help debugging PR#4399, that would be
> much appreciated.)

Alas, I have not migrated to Vista yet. But once the reporter has
Visual C++ experience I would recommend him to build OCaml from
sources with debug info enabled (if won't compile out-of-the-box but
the fix is trivial) and launch ocamlwin under debugger. When it should
become obvious where the access violation occurs.

> Coming back to ocamldebug:
> > The point is not to modify win32unix library or write Win32-specific C
> > functions for ocamldebug. I believe it's necessary to be ever accepted
> > by INRIA.
> Actually, I would be happy with a Win32 implementation of
> that works over any combination of sockets and file descriptors.
> Unfortunately, it looks like we'd need a gross hack involving threads,
> WaitForMultipleObjects() and select(), but if someone comes up with an
> implementation that isn't too gross, I'll be interested.

Indeed, porting select() to Windows would be preferable.
WaitForMultipleObjects() can wait for console, pipe and network events
simultaneously so this should not be that hard (and multiple threads
are probably not necessary). Of course, there are some pitfalls like
this (taken from Cygwin sources):

      /* Some types of object (e.g., consoles) wake up on "inappropriate" events
         like mouse movements.  The verify function will detect these
         If it returns false, then this wakeup was a false alarm and
we should go
         back to waiting. */

But at least I'll try.

- Dmitry Bely