From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id B1F21BC6C for ; Tue, 5 Feb 2008 18:31:13 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKorqEfAXQInh2dsb2JhbACQLAEBAQgKKZZlhgA X-IronPort-AV: E=Sophos;i="4.25,308,1199660400"; d="scan'208";a="8795966" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Feb 2008 18:31:13 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m15HV6OZ016261 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 5 Feb 2008 18:31:13 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAF4sqEfRVY66nmdsb2JhbACQLAEBAQEBBgQGBwoYlmaFfg X-IronPort-AV: E=Sophos;i="4.25,308,1199660400"; d="scan'208";a="7643661" Received: from ti-out-0910.google.com ([209.85.142.186]) by mail1-smtp-roc.national.inria.fr with ESMTP; 05 Feb 2008 18:30:51 +0100 Received: by ti-out-0910.google.com with SMTP id b8so12788tic.9 for ; Tue, 05 Feb 2008 09:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Icps4cqkSQJHAZj2CVuixTdTbtdmd9ZsMMq4HoS1/Uw=; b=UcVn6ge2CTjLy+HwnJD5ui+HoeMledmlfLsfCo5bw6R2j1uC7MCM+0v6Eq9IVhRq1XEza1uQ6JwuWEkDBymVo9wUvRytpl6FMe6paDDempuB1XFClqnVQ2KF5Ddaw276YHtimRnvc1Xrs+6e0Zafn3WRrlbIKcBaleJxdDtDwFQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AJewi+npvLRu1HHn6/zXO2ykTnuxEU6p12XCxVwnklvbN/JOFsdX43WbRRFr1ZxGvvoZhttA7aNCvhD8+M8dxqz4Fcam1qYtMKoIcQwOLNDl4PPktCtTYbxShVtY7x0GXtz1TXe76k5PXnIqvJLaHuaZrtiQDIHv4aEz/bYj0E4= Received: by 10.110.32.9 with SMTP id f9mr4188593tif.32.1202232212917; Tue, 05 Feb 2008 09:23:32 -0800 (PST) Received: by 10.110.26.14 with HTTP; Tue, 5 Feb 2008 09:23:32 -0800 (PST) Message-ID: <90823c940802050923h77a95192gdabcd9c0807dccd6@mail.gmail.com> Date: Tue, 5 Feb 2008 20:23:32 +0300 From: "Dmitry Bely" To: "Alain Frisch" Subject: Re: [Caml-list] Ocaml debugger under Windows Cc: ocaml In-Reply-To: <47A83251.7010306@frisch.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <90823c940802050146u7cac0aape4e72b4fc6a3089@mail.gmail.com> <47A83251.7010306@frisch.fr> X-Miltered: at concorde with ID 47A89D5A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 debugger:01 frisch:01 frisch:01 ocaml:01 mingw:01 mingw:01 debugger:01 iter:01 funct:01 funct:01 eintr:01 ocamldebug:01 threads:01 wrote:01 On Feb 5, 2008 12:54 PM, Alain Frisch wrote: > Dmitry Bely wrote: > > 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). > >... > > If it's interesting for anyone I can publish a patch against Ocaml 3.10.1 > > Yes, that's definitely interesting for us! > > Is there any hope to build the server with the mingw or msvc port? As soon as the following function is rewritten: debugger/input_handling.ml (* Handle active files until `continue_main_loop' is false. *) let main_loop () = let old_state = !continue_main_loop in try continue_main_loop := true; while !continue_main_loop do try let (input, _, _) = select (List.map fst !active_files) [] [] (-1.) in List.iter (function fd -> let (funct, iochan) = (List.assoc fd !active_files) in funct iochan) input with Unix_error (EINTR, _, _) -> () done; continue_main_loop := old_state with x -> continue_main_loop := old_state; raise x here Unix.select() waits for both network and user input events. We could split this into 2 threads, but how to interrupt network select() when we going to exit? Well, we could use some small timeout value for select() (say 500ms) and restart it the loop when !continue_main_loop is set, but this looks not very elegant... Or it's OK? 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. - Dmitry Bely