caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Ocaml debugger under Windows
@ 2008-02-05  9:46 Dmitry Bely
  2008-02-05  9:54 ` [Caml-list] " Alain Frisch
  0 siblings, 1 reply; 12+ messages in thread
From: Dmitry Bely @ 2008-02-05  9:46 UTC (permalink / raw)
  To: ocaml

[-- Attachment #1: Type: text/plain, Size: 2348 bytes --]

The topic has a long history [1], but since then nothing has actually
changed. It's easy to understand: INRIA people are busy and there are
probably quite few Ocaml users in the Windows land to worry about. So I
decided to do something myself :) (as it was with mingw port several years
ago).

Let's go into detail. Ocam debugger consists of the the two parts: the
client (byterun/debugger.c linked into debuggee) and the server
(ocamldebug). The following issues should be addressed to make a Windows
port:

1. Checkpointing is done via Unix fork() (client)

The most problematic one. I have spend a fair amount of time trying to find
an acceptable solution.
a) direct port of fork() to Windows. There is a BSD-licenced Windows fork()
in tcsh sources [2] that could be used. It's based on Cygwin ideas. But how
to handle dynamically loaded DLLs (loaded via LoadLibrary())? I asked the
author (Amol Deshpande) and he replied:

"DLLs that are dynamically loaded are a can of worms. I would not support
those if I were you."

BTW, does Cygwin do this right? I doubt at least.

b) some checkpoint library. Although Web search gives many references, e.g.
[3], I have not found yet anything ready-to-use, even commercial!

2. Unix select (server)

It is a problem because server waits for network and console events
simultaneously. To work on Windows the main loop should probably be
multi-threaded.

3. Unix sockets (client & server)

Probably can be ignored. Internet sockets are quite enough.

So what is done now.

- Client

It's ported without (1) and (3). To me it's quite usable even without
checkpoints.

- Server

I don't bother to do (2) right now (until the whole idea is accepted).
Currently I use cygwin-compiled ocamldebug with checkpoints and Unix sockets
disabled by default. It works well with the native Win32 clients.

- OcaIDE

Yes, with minor changes in OcaIDE the debugged works there.

If it's interesting for anyone I can publish a patch against Ocaml 3.10.1

- Dmitry Bely

[1]
http://caml.inria.fr/pub/ml-archives/caml-list/1999/03/f44178e212e78826bcbdee52ddf6fd91.en.html
http://caml.inria.fr/pub/ml-archives/caml-list/2002/10/ed776d7376ed7a9676d4a9981372ccdf.fr.html

[2] http://www.tcsh.org/MostRecentRelease

[3]
http://www.usenix.org/publications/library/proceedings/usenix-nt98/full_papers/srouji/srouji_html/srouji.html

[-- Attachment #2: Type: text/html, Size: 2950 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-05-03 18:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-05  9:46 Ocaml debugger under Windows Dmitry Bely
2008-02-05  9:54 ` [Caml-list] " Alain Frisch
2008-02-05 17:23   ` Dmitry Bely
2008-02-05 17:40     ` Benedikt Grundmann
2008-02-05 19:39       ` Dmitry Bely
2008-02-05 21:00         ` Alain Frisch
2008-02-06  8:56           ` Dmitry Bely
2008-02-06 17:12     ` Xavier Leroy
2008-02-06 18:22       ` Dmitry Bely
2008-05-03 18:39       ` Dmitry Bely
2008-02-08 13:27     ` Kuba Ober
2008-02-08 16:33       ` Dmitry Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).