Commit 0802502f authored by erwan's avatar erwan
Browse files

rdbg: add a previous_round command (based on the new event based checkpoints mecanism)

parent 957c3d97
(* Some useful short-cuts for rdbg interactive sessions *)
let _ = time_travel true;;
let _ = time_travel true;;
let e = ref (RdbgStdLib.run());;
let s () = e:=step !e;;
let si i = e:=stepi !e i;;
......@@ -43,7 +45,57 @@ let sd () = s();ci();;
let nd () = n();ci();;
let bd () = b();ci();;
let nr () = e:=next_round p.nodes dotfile !e; circo p dotfile !e;;
(**********************************************************************)
let round_nodes = ref []
let get_removable pl =
let pl = List.filter
(fun p ->
(List.exists (fun (_,_,acti) -> acti) p.actions) ||
(List.for_all (fun (_,enab,_) -> (not enab)) p.actions)
)
pl
in
List.map (fun p -> p.name) pl
let verbose = ref false
let (round : Event.t -> bool) =
fun e ->
let (pl : process list) = get_processes e in
let removable = get_removable pl in
if !verbose then (
Printf.printf "Current process: %s\n" (String.concat "," !round_nodes);
Printf.printf "Removable process: %s\n" (String.concat "," removable);
flush stdout;
);
round_nodes :=
List.filter (fun pid -> not (List.mem pid removable)) !round_nodes;
let res = !round_nodes = [] in
if res then round_nodes := (
let p_with_enable_action =
List.filter
(fun p -> List.exists
(fun (_,enab,acti) -> enab&&not(acti)) p.actions)
pl
in
let pidl = List.map (fun p -> p.name) p_with_enable_action in
let pidl = List.rev pidl in
if !verbose then (
Printf.printf "The processes to check : %s\n" (String.concat "," pidl);
flush stdout
);
pidl
);
res
let nr () = e:=next_round !e; circo p dotfile !e;;
let pr () = e:=goto_last_ckpt !e.nb;;
(**********************************************************************)
let _ = check_ref := round;;
let _ = print_string "
--> type 'man' for online help
......
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