Re: Debugger under Windows...

From: Xavier Leroy (Xavier.Leroy@inria.fr)
Date: Thu Mar 04 1999 - 18:01:27 MET


Date: Thu, 4 Mar 1999 18:01:27 +0100
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Manuel Fahndrich <maf@microsoft.com>,
Subject: Re: Debugger under Windows...
In-Reply-To: <25983782061AD111B0800000F86310FE1026CB4B@RED-MSG-42>; from Manuel Fahndrich on Wed, Mar 03, 1999 at 01:50:07PM -0800

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

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



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:20 MET