1996-11-29 08:55:09 -08:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
1996-11-29 08:55:09 -08:00
|
|
|
(* *)
|
|
|
|
(* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml port by John Malecki and Xavier Leroy *)
|
1996-11-29 08:55:09 -08:00
|
|
|
(* *)
|
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1996-11-29 08:55:09 -08:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* Low-level communication with the debuggee *)
|
|
|
|
|
|
|
|
type execution_summary =
|
|
|
|
Event
|
|
|
|
| Breakpoint
|
|
|
|
| Exited
|
|
|
|
| Trap_barrier
|
|
|
|
| Uncaught_exc
|
|
|
|
|
|
|
|
type report =
|
|
|
|
{ rep_type : execution_summary;
|
|
|
|
rep_event_count : int;
|
|
|
|
rep_stack_pointer : int;
|
|
|
|
rep_program_pointer : int }
|
|
|
|
|
|
|
|
type checkpoint_report =
|
|
|
|
Checkpoint_done of int
|
|
|
|
| Checkpoint_failed
|
|
|
|
|
2010-04-20 08:47:15 -07:00
|
|
|
type follow_fork_mode =
|
|
|
|
Fork_child
|
|
|
|
| Fork_parent
|
|
|
|
|
1996-11-29 08:55:09 -08:00
|
|
|
(* Set the current connection with the debuggee *)
|
|
|
|
val set_current_connection : Primitives.io_channel -> unit
|
|
|
|
|
|
|
|
(* Put an event at given pc *)
|
|
|
|
val set_event : int -> unit
|
|
|
|
|
|
|
|
(* Put a breakpoint at given pc *)
|
|
|
|
val set_breakpoint : int -> unit
|
|
|
|
|
|
|
|
(* Remove breakpoint or event at given pc *)
|
|
|
|
val reset_instr : int -> unit
|
|
|
|
|
|
|
|
(* Create a new checkpoint (the current process forks). *)
|
|
|
|
val do_checkpoint : unit -> checkpoint_report
|
|
|
|
|
|
|
|
(* Step N events. *)
|
2002-10-29 09:53:24 -08:00
|
|
|
val do_go : int64 -> report
|
1996-11-29 08:55:09 -08:00
|
|
|
|
|
|
|
(* Tell given process to terminate *)
|
|
|
|
val stop : Primitives.io_channel -> unit
|
|
|
|
|
|
|
|
(* Tell given process to wait for its children *)
|
|
|
|
val wait_child : Primitives.io_channel -> unit
|
|
|
|
|
|
|
|
(* Move to initial frame (that of current function). *)
|
|
|
|
(* Return stack position and current pc *)
|
|
|
|
val initial_frame : unit -> int * int
|
1998-12-02 02:39:54 -08:00
|
|
|
val set_initial_frame : unit -> unit
|
1996-11-29 08:55:09 -08:00
|
|
|
|
|
|
|
(* Get the current frame position *)
|
|
|
|
(* Return stack position and current pc *)
|
|
|
|
val get_frame : unit -> int * int
|
|
|
|
|
|
|
|
(* Set the current frame *)
|
|
|
|
val set_frame : int -> unit
|
|
|
|
|
|
|
|
(* Move up one frame *)
|
|
|
|
(* Return stack position and current pc.
|
|
|
|
If there's no frame above, return (-1, 0). *)
|
|
|
|
val up_frame : int -> int * int
|
|
|
|
|
|
|
|
(* Set the trap barrier to given stack position. *)
|
|
|
|
val set_trap_barrier : int -> unit
|
|
|
|
|
2010-04-20 08:47:15 -07:00
|
|
|
(* Set whether the debugger follow the child or the parent process on fork *)
|
|
|
|
val fork_mode : follow_fork_mode ref
|
|
|
|
val update_follow_fork_mode : unit -> unit
|
|
|
|
|
1996-11-29 08:55:09 -08:00
|
|
|
(* Handling of remote values *)
|
|
|
|
|
1997-02-14 08:30:00 -08:00
|
|
|
exception Marshalling_error
|
1997-03-22 12:16:52 -08:00
|
|
|
|
|
|
|
module Remote_value :
|
|
|
|
sig
|
|
|
|
type t
|
2010-01-22 04:48:24 -08:00
|
|
|
|
1997-03-22 12:16:52 -08:00
|
|
|
val obj : t -> 'a
|
|
|
|
val is_block : t -> bool
|
|
|
|
val tag : t -> int
|
|
|
|
val size : t -> int
|
|
|
|
val field : t -> int -> t
|
2000-03-26 04:11:10 -08:00
|
|
|
val same : t -> t -> bool
|
1997-03-22 12:16:52 -08:00
|
|
|
|
|
|
|
val of_int : int -> t
|
|
|
|
|
|
|
|
val local : int -> t
|
|
|
|
val from_environment : int -> t
|
|
|
|
val global : int -> t
|
|
|
|
val accu : unit -> t
|
|
|
|
val closure_code : t -> int
|
2000-03-26 04:11:10 -08:00
|
|
|
|
2015-02-12 13:31:20 -08:00
|
|
|
(* Returns a hexadecimal representation of the remote address,
|
|
|
|
or [""] if the value is local. *)
|
|
|
|
val pointer : t -> string
|
1997-03-22 12:16:52 -08:00
|
|
|
end
|