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
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(********************************* Events ******************************)
|
|
|
|
|
|
|
|
open Instruct
|
|
|
|
|
2005-08-25 08:35:16 -07:00
|
|
|
let get_pos ev =
|
|
|
|
match ev.ev_kind with
|
|
|
|
| Event_before -> ev.ev_loc.Location.loc_start
|
|
|
|
| Event_after _ -> ev.ev_loc.Location.loc_end
|
|
|
|
| _ -> ev.ev_loc.Location.loc_start
|
|
|
|
;;
|
|
|
|
|
1996-11-29 08:55:09 -08:00
|
|
|
|
|
|
|
(*** Current events. ***)
|
|
|
|
|
|
|
|
(* Event at current position *)
|
|
|
|
let current_event =
|
|
|
|
ref (None : debug_event option)
|
|
|
|
|
|
|
|
(* Current position in source. *)
|
|
|
|
(* Raise `Not_found' if not on an event (beginning or end of program). *)
|
2005-08-25 08:35:16 -07:00
|
|
|
let get_current_event () =
|
1996-11-29 08:55:09 -08:00
|
|
|
match !current_event with
|
2005-08-25 08:35:16 -07:00
|
|
|
| None -> raise Not_found
|
|
|
|
| Some ev -> ev
|
1996-11-29 08:55:09 -08:00
|
|
|
|
|
|
|
let current_event_is_before () =
|
|
|
|
match !current_event with
|
|
|
|
None ->
|
|
|
|
raise Not_found
|
|
|
|
| Some {ev_kind = Event_before} ->
|
|
|
|
true
|
|
|
|
| _ ->
|
|
|
|
false
|