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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-03-04 (18:57)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: Debugger under Windows...
> What would be involved in porting the OCAML debugger to Windows?
> - Is the problem just the debugger application and the graphical user
> interface, or
> - the generation of debuggable OCAML code by the compiler under windows.
> I'm especially interested in the native code debugger, but even a bytecode
> debugger would be useful under Windows.

OCaml doesn't support debugging of native code on any platform.  Well,
you can use gdb to debug at the assembly level, but I don't recommend it...

Concerning bytecode debugging under Windows, the major issue is the
way our debugger performs periodic checkpointing of the running program
(in order to implement reverse execution).  We just use the Unix fork()
system call, which does everything we want (checkpointing of memory
and file descriptors, using lazy copy-on-write to minimize copying).

Unfortunately, Win32 doesn't have any equivalent to fork().
The POSIX subsystem of NT does have fork(), but is otherwise unusable
(no sockets, no GUI, etc).  I looked hard on the Web but couldn't find
any general-purpose checkpointing library for Win32.

Some Unix compatibility libraries provide decent emulations of fork()
(although they run a bit slowly).  This is the case for Cygnus's Cygwin
system.  However, Cygwin doesn't support threads, and I doubt that it
supports some other Win32 features that are important for us, such as

So, the current alternatives are:

- Port the debugger without the replay facilitity.  Unfortunately,
that would make it a lot less usable.

- Recompile the whole OCaml system with Cygwin gcc instead of
Microsoft VC++.  We'd lose threads and probably more.

- Find or write a decent checkpointing facility for Win32.  Any help
with this would be great.

All the best,

- Xavier Leroy