Commit b854552c authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Fix the bug described in the previous commit, by usinf a failure continuation.

There is still one problem: the rdbg and the lurette mode do not
generated the same sequence. The event number is the same. The
sequence of Random.init (performed when the event number is
incremented) is exactly the same too. Weird.

Note that this divergence is a regression
parent a919ca61
This diff is collapsed.
...@@ -99,7 +99,6 @@ val get_init_internal_state : t -> internal_state ...@@ -99,7 +99,6 @@ val get_init_internal_state : t -> internal_state
(* can/must be abstract ? *) (* can/must be abstract ? *)
(* = { data: Var.env; ctrl: control_state } *) (* = { data: Var.env; ctrl: control_state } *)
exception Stop exception Stop
exception Deadlock of int
exception Exception of string exception Exception of string
(* debug *) (* debug *)
......
...@@ -106,23 +106,26 @@ let set_seed opt s = ...@@ -106,23 +106,26 @@ let set_seed opt s =
*) *)
(* let event_nb = ref 0 *) (* let event_nb = ref 0 *)
let event_incr opt = let event_incr opt =
let seed = match opt._seed with Some i -> i | None -> assert false in let seed = seed opt in
let r = Random.int 1073741823 in
opt._event_nb <- opt._event_nb + 1; opt._event_nb <- opt._event_nb + 1;
Random.init (seed + opt._event_nb) Random.full_init [|seed; opt._event_nb|];
Printf.fprintf
stderr "The random engine seed is set with (%i,%i) (%i,%i)\n"
opt._event_nb seed r (Random.int 1073741823);
flush stderr;
()
let (get_event_nb : t -> int) = let (get_event_nb : t -> int) =
fun opt -> fun opt ->
opt._event_nb opt._event_nb
(* all unrecognized options are accumulated *) (* all unrecognized options are accumulated *)
let (add_other : t -> string -> unit) = let (add_other : t -> string -> unit) =
fun opt s -> fun opt s ->
opt._others <- s::opt._others opt._others <- s::opt._others
let infile opt = opt._infile let infile opt = opt._infile
let test_lex opt = opt._test_lex let test_lex opt = opt._test_lex
let test_parse opt = opt._test_parse let test_parse opt = opt._test_parse
......
...@@ -7,12 +7,13 @@ let step p = match p with DoStep _p -> _p ...@@ -7,12 +7,13 @@ let step p = match p with DoStep _p -> _p
type prg_ldbg = type prg_ldbg =
DoStep_ldbg of (Event.ctx -> Value.t list -> DoStep_ldbg of (Event.ctx -> Value.t list ->
(Event.ctx -> prg_ldbg -> Value.t list -> Event.t) -> Event.t) (Event.ctx -> prg_ldbg -> Value.t list -> Event.t) ->
(Event.ctx -> Event.t) -> Event.t)
let (step_ldbg : Event.ctx -> let (step_ldbg : Event.ctx ->
prg_ldbg -> Value.t list -> (Event.ctx -> prg_ldbg -> Value.t list -> Event.t) prg_ldbg -> Value.t list -> (Event.ctx -> prg_ldbg -> Value.t list -> Event.t)
-> Event.t) = -> (Event.ctx -> Event.t) -> Event.t) =
fun ctx p vl cont -> fun ctx p vl cont fail_cont ->
match p with DoStep_ldbg _p -> _p ctx vl cont match p with DoStep_ldbg _p -> _p ctx vl cont fail_cont
...@@ -7,9 +7,11 @@ val step : prg -> Value.t list -> (Value.t list * prg) ...@@ -7,9 +7,11 @@ val step : prg -> Value.t list -> (Value.t list * prg)
type prg_ldbg = type prg_ldbg =
DoStep_ldbg of ( Event.ctx -> Value.t list -> DoStep_ldbg of ( Event.ctx -> Value.t list ->
(Event.ctx -> prg_ldbg -> Value.t list -> Event.t) -> Event.t) (Event.ctx -> prg_ldbg -> Value.t list -> Event.t) ->
(Event.ctx -> Event.t) -> Event.t)
val step_ldbg : Event.ctx -> prg_ldbg -> Value.t list -> val step_ldbg : Event.ctx -> prg_ldbg -> Value.t list ->
(Event.ctx -> prg_ldbg -> Value.t list -> Event.t) -> Event.t (Event.ctx -> prg_ldbg -> Value.t list -> Event.t) ->
(Event.ctx -> Event.t) -> Event.t
let str="1.57" let str="1.57"
let sha="440b75d" let sha="a919ca6"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment