diff -aur original/command_line.ml patched/command_line.ml
--- original/command_line.ml	2014-04-13 09:05:24.000000000 +0200
+++ patched/command_line.ml	2014-04-13 09:05:24.000000000 +0200
@@ -75,11 +75,7 @@
   raise Toplevel
 
 let check_not_windows feature =
-  match Sys.os_type with
-  | "Win32" ->
-      error ("'"^feature^"' feature not supported on Windows")
-  | _ ->
-      ()
+  ignore (error ("'" ^ feature ^ "' feature not supported"))
 
 let eol =
   end_of_line Lexer.lexeme
diff -aur original/debugcom.ml patched/debugcom.ml
--- original/debugcom.ml	2014-04-13 09:05:24.000000000 +0200
+++ patched/debugcom.ml	2014-04-13 09:05:24.000000000 +0200
@@ -114,13 +114,7 @@
 (* Perform a checkpoint *)
 
 let do_checkpoint () =
-  match Sys.os_type with
-    "Win32" -> failwith "do_checkpoint"
-  | _ ->
-      output_char !conn.io_out 'c';
-      flush !conn.io_out;
-      let pid = input_binary_int !conn.io_in in
-      if pid = -1 then Checkpoint_failed else Checkpoint_done pid
+  failwith "do_checkpoint"
 
 (* Kill the given process. *)
 let stop chan =
@@ -211,7 +205,7 @@
 
     let is_block = function
     | Local obj -> Obj.is_block obj
-    | Remote v -> Obj.is_block (Array.unsafe_get (Obj.magic v : Obj.t array) 0)
+    | Remote v -> ((Char.code v.[0]) land 1) = 0
 
     let tag = function
     | Local obj -> Obj.tag obj
@@ -244,10 +238,16 @@
           if input_byte !conn.io_in = 0 then
             Remote(input_remote_value !conn.io_in)
           else begin
-            let buf = Misc.input_bytes !conn.io_in 8 in
-            let floatbuf = float n (* force allocation of a new float *) in
-            String.unsafe_blit buf 0 (Obj.magic floatbuf) 0 8;
-            Local(Obj.repr floatbuf)
+            let buf = String.create 8 in
+            really_input !conn.io_in buf 0 8;
+            let bits = ref Int64.zero in
+            for i = 0 to pred (String.length buf) do
+              bits := Int64.(logor
+                               (shift_left !bits 8)
+                               (of_int (Char.code buf.[i])))
+            done;
+            let res = Int64.float_of_bits !bits in
+            Local(Obj.repr res)
           end
 
     let of_int n =
diff -aur original/debugger_config.ml patched/debugger_config.ml
--- original/debugger_config.ml	2014-04-13 09:05:24.000000000 +0200
+++ patched/debugger_config.ml	2014-04-13 09:05:24.000000000 +0200
@@ -74,10 +74,7 @@
 let checkpoint_max_count = ref 15
 
 (* Whether to keep checkpoints or not. *)
-let make_checkpoints = ref
-  (match Sys.os_type with
-    "Win32" -> false
-  | _ -> true)
+let make_checkpoints = ref false
 
 (*** Environment variables for debugee. ***)
 
diff -aur original/exec.ml patched/exec.ml
--- original/exec.ml	2014-04-13 09:05:24.000000000 +0200
+++ patched/exec.ml	2014-04-13 09:05:24.000000000 +0200
@@ -22,13 +22,6 @@
   then interrupted := true
   else raise Sys.Break
 
-let _ =
-  match Sys.os_type with
-    "Win32" -> ()
-  | _ ->
-      Sys.set_signal Sys.sigint (Sys.Signal_handle break);
-      Sys.set_signal Sys.sigpipe (Sys.Signal_handle(fun _ -> raise End_of_file))
-
 let protect f =
   if !is_protected then
     f ()
diff -aur original/input_handling.ml patched/input_handling.ml
--- original/input_handling.ml	2014-04-13 09:05:24.000000000 +0200
+++ patched/input_handling.ml	2014-04-13 09:05:24.000000000 +0200
@@ -68,13 +68,13 @@
       while !continue_main_loop do
         try
           let (input, _, _) =
-            select (List.map fst !active_files) [] [] (-1.)
+            (List.map fst !active_files), [], []
           in
             List.iter
               (function fd ->
                  let (funct, iochan) = (List.assoc fd !active_files) in
                    funct iochan)
-              input
+              [(List.hd input)]
         with
           Unix_error (EINTR, _, _) -> ()
       done;
diff -aur original/main.ml patched/main.ml
--- original/main.ml	2014-04-13 09:05:24.000000000 +0200
+++ patched/main.ml	2014-04-13 09:05:24.000000000 +0200
@@ -186,17 +186,13 @@
   raise Not_found
 
 let main () =
+  Random.self_init ();
   Callback.register "Debugger.function_placeholder" function_placeholder;
   try
     socket_name :=
-      (match Sys.os_type with
-        "Win32" ->
-          (Unix.string_of_inet_addr Unix.inet_addr_loopback)^
-          ":"^
-          (string_of_int (10000 + ((Unix.getpid ()) mod 10000)))
-      | _ -> Filename.concat Filename.temp_dir_name
-                                ("camldebug" ^ (string_of_int (Unix.getpid ())))
-      );
+      (Unix.string_of_inet_addr Unix.inet_addr_loopback) ^
+      ":" ^
+      (string_of_int (10000 + ((Random.bits ()) mod 10000)));
     begin try
       Arg.parse speclist anonymous "";
       Arg.usage speclist
diff -aur original/program_loading.ml patched/program_loading.ml
--- original/program_loading.ml	2014-04-13 09:05:24.000000000 +0200
+++ patched/program_loading.ml	2014-04-13 09:05:24.000000000 +0200
@@ -66,88 +66,6 @@
   done;
   Buffer.contents res
 
-(* A generic function for launching the program *)
-let generic_exec_unix cmdline = function () ->
-  if !debug_loading then
-    prerr_endline "Launching program...";
-  let child =
-    try
-      fork ()
-    with x ->
-      Unix_tools.report_error x;
-      raise Toplevel in
-  match child with
-    0 ->
-      begin try
-         match fork () with
-           0 -> (* Try to detach the process from the controlling terminal,
-                   so that it does not receive SIGINT on ctrl-C. *)
-                begin try ignore(setsid()) with Invalid_argument _ -> () end;
-                execve shell [| shell; "-c"; cmdline() |] (get_environment ())
-         | _ -> exit 0
-       with x ->
-         Unix_tools.report_error x;
-         exit 1
-       end
-  | _ ->
-     match wait () with
-       (_, WEXITED 0) -> ()
-     | _ -> raise Toplevel
-
-let generic_exec_win cmdline = function () ->
-  if !debug_loading then
-    prerr_endline "Launching program...";
-  try ignore(create_process "cmd.exe" [| "/C"; cmdline() |] stdin stdout stderr)
-  with x ->
-    Unix_tools.report_error x;
-    raise Toplevel
-
-let generic_exec =
-  match Sys.os_type with
-    "Win32" -> generic_exec_win
-  | _ -> generic_exec_unix
-
-(* Execute the program by calling the runtime explicitly *)
-let exec_with_runtime =
-  generic_exec
-    (function () ->
-      match Sys.os_type with
-        "Win32" ->
-          (* This fould fail on a file name with spaces
-             but quoting is even worse because Unix.create_process
-             thinks each command line parameter is a file.
-             So no good solution so far *)
-          Printf.sprintf "%sset CAML_DEBUG_SOCKET=%s && %s %s %s"
-                     (get_win32_environment ())
-                     !socket_name
-                     runtime_program
-                     !program_name
-                     !arguments
-      | _ ->
-          Printf.sprintf "CAML_DEBUG_SOCKET=%s %s %s %s"
-                     !socket_name
-                     (Filename.quote runtime_program)
-                     (Filename.quote !program_name)
-                     !arguments)
-
-(* Excute the program directly *)
-let exec_direct =
-  generic_exec
-    (function () ->
-      match Sys.os_type with
-        "Win32" ->
-          (* See the comment above *)
-          Printf.sprintf "%sset CAML_DEBUG_SOCKET=%s && %s %s"
-                     (get_win32_environment ())
-                     !socket_name
-                     !program_name
-                     !arguments
-      | _ ->
-          Printf.sprintf "CAML_DEBUG_SOCKET=%s %s %s"
-                     !socket_name
-                     (Filename.quote !program_name)
-                     !arguments)
-
 (* Ask the user. *)
 let exec_manual =
   function () ->
@@ -161,9 +79,7 @@
 type launching_function = (unit -> unit)
 
 let loading_modes =
-  ["direct", exec_direct;
-   "runtime", exec_with_runtime;
-   "manual", exec_manual]
+  ["manual", exec_manual]
 
 let set_launching_function func =
   launching_func := func
@@ -171,7 +87,7 @@
 (* Initialization *)
 
 let _ =
-  set_launching_function exec_direct
+  set_launching_function exec_manual
 
 (*** Connection. ***)
 
diff -aur original/unix_tools.ml patched/unix_tools.ml
--- original/unix_tools.ml	2014-04-13 09:05:24.000000000 +0200
+++ patched/unix_tools.ml	2014-04-13 09:05:24.000000000 +0200
@@ -34,9 +34,7 @@
                prerr_endline "The port number should be an integer";
                failwith "Can't convert address")))
   with Not_found ->
-    match Sys.os_type with
-      "Win32" -> failwith "Unix sockets not supported"
-    | _ -> (PF_UNIX, ADDR_UNIX address)
+    failwith "Unix sockets not supported"
 
 (*** Report a unix error. ***)
 let report_error = function
