1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *)
6 (* OCaml port by John Malecki and Xavier Leroy *)
7 (* *)
8 (* Copyright 1996 Institut National de Recherche en Informatique et *)
9 (* en Automatique. *)
10 (* *)
11 (* All rights reserved. This file is distributed under the terms of *)
12 (* the GNU Lesser General Public License version 2.1, with the *)
13 (* special exception on linking described in the file LICENSE. *)
14 (* *)
15 (**************************************************************************)
16
17 (***************************** Checkpoints *****************************)
18
19 open Primitives
20 open Debugcom
21
22 (*** A type for checkpoints. ***)
23
24 type checkpoint_state =
25 C_stopped
26 | C_running of int64
27
28 (* `c_valid' is true if and only if the corresponding
29 * process is connected to the debugger.
30 * `c_parent' is the checkpoint whose process is parent
31 * of the checkpoint one (`root' if no parent).
32 * c_pid = 2 for root pseudo-checkpoint.
33 * c_pid = 0 for ghost checkpoints.
34 * c_pid = -1 for kill checkpoints.
35 *)
36 type checkpoint =
37 {mutable c_time : int64;
38 mutable c_pid : int;
39 mutable c_fd : io_channel;
40 mutable c_valid : bool;
41 mutable c_report : report option;
42 mutable c_state : checkpoint_state;
43 mutable c_parent : checkpoint;
44 mutable c_breakpoint_version : int;
45 mutable c_breakpoints : (pc * int ref) list;
46 mutable c_trap_barrier : int;
47 mutable c_code_fragments : int list}
48
49 (*** Pseudo-checkpoint `root'. ***)
50 (* --- Parents of all checkpoints which have no parent. *)
51 val root : checkpoint
52
53 (*** Current state ***)
54 val checkpoints : checkpoint list ref
55 val current_checkpoint : checkpoint ref
56
57 val current_time : unit -> int64
58 val current_report : unit -> report option
59 val current_pc : unit -> pc option
60 val current_pc_sp : unit -> (pc * int) option
61