From 675b6539607f387d43b8d7e04de31292b4246a1b Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 15 Jan 2020 11:36:28 +0100 Subject: Adding more debug elements --- backend/Duplicateaux.ml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'backend') diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml index 1a41ed79..ec99027a 100644 --- a/backend/Duplicateaux.ml +++ b/backend/Duplicateaux.ml @@ -252,16 +252,24 @@ let get_directions code entrypoint = List.iter (fun n -> match (get_some @@ PTree.get n code) with | Icond (cond, lr, ifso, ifnot) -> + Printf.printf "Analyzing %d.." (P.to_int n); let preferred = ref false in (try + Printf.printf " call.."; do_call_heuristic code ifso ifnot is_loop_header preferred; + Printf.printf " opcode.."; do_opcode_heuristic code cond ifso ifnot preferred; + Printf.printf " return.."; do_return_heuristic code ifso ifnot is_loop_header preferred; + Printf.printf " store.."; do_store_heuristic code ifso ifnot is_loop_header preferred; + Printf.printf " loop.."; do_loop_heuristic code ifso ifnot is_loop_header preferred; Printf.printf "Random choice for %d\n" (P.to_int n); preferred := Random.bool () - with HeuristicSucceeded | DuplicateOpcodeHeuristic.HeuristicSucceeded -> () + with HeuristicSucceeded | DuplicateOpcodeHeuristic.HeuristicSucceeded + -> Printf.printf " %s\n" (match !preferred with true -> "BRANCH" + | false -> "FALLTHROUGH") ); directions := PTree.set n !preferred !directions | _ -> () ) bfs_order; -- cgit