2016-02-18 07:11:59 -08:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* OCaml *)
|
|
|
|
(* *)
|
|
|
|
(* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* OCaml port by John Malecki and Xavier Leroy *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. This file is distributed under the terms of *)
|
|
|
|
(* the GNU Lesser General Public License version 2.1, with the *)
|
|
|
|
(* special exception on linking described in the file LICENSE. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
1996-11-29 08:55:09 -08:00
|
|
|
|
2002-10-29 09:53:24 -08:00
|
|
|
open Int64ops
|
1996-11-29 08:55:09 -08:00
|
|
|
open Checkpoints
|
|
|
|
open Primitives
|
|
|
|
open Debugger_config
|
|
|
|
|
2002-10-29 09:53:24 -08:00
|
|
|
let history = ref ([] : int64 list)
|
1996-11-29 08:55:09 -08:00
|
|
|
|
|
|
|
let empty_history () =
|
|
|
|
history := []
|
|
|
|
|
|
|
|
let add_current_time () =
|
|
|
|
let time = current_time () in
|
2002-10-29 09:53:24 -08:00
|
|
|
if !history = [] then
|
1996-11-29 08:55:09 -08:00
|
|
|
history := [time]
|
|
|
|
else if time <> List.hd !history then
|
|
|
|
history := list_truncate !history_size (time::!history)
|
|
|
|
|
|
|
|
let previous_time_1 () =
|
|
|
|
match !history with
|
|
|
|
_::((time::_) as hist) ->
|
|
|
|
history := hist; time
|
|
|
|
| _ ->
|
|
|
|
prerr_endline "No more information."; raise Toplevel
|
|
|
|
|
|
|
|
let rec previous_time n =
|
2002-10-29 09:53:24 -08:00
|
|
|
if n = _1
|
1996-11-29 08:55:09 -08:00
|
|
|
then previous_time_1()
|
2002-10-29 09:53:24 -08:00
|
|
|
else begin ignore(previous_time_1()); previous_time(pre64 n) end
|