From d9b6a0a4a2d8d02374403410fc3ba29b1c40efdf Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Mon, 8 Feb 2016 15:01:33 +0100
Subject: [PATCH] Take into account the change in Rdbg.event w.r.t. event
 number (rdbg 1.51).

---
 INSTALL.txt           |  4 ++--
 _oasis                |  6 +++---
 src/lus2licRun.ml     |  4 ++--
 src/lustre-v6.mldylib |  3 ++-
 src/lustre-v6.mllib   |  3 ++-
 src/lv6version.ml     |  4 ++--
 src/socExecDbg.ml     | 18 ++++++++++--------
 src/socExecDbg.mli    |  4 ++--
 test/lus2lic.sum      | 26 +++++++++++++-------------
 9 files changed, 38 insertions(+), 34 deletions(-)

diff --git a/INSTALL.txt b/INSTALL.txt
index eb28a172..8cbc168c 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -1,5 +1,5 @@
 (* OASIS_START *)
-(* DO NOT EDIT (digest: cca22f7f85a2d3f909460a1c1938ad46) *)
+(* DO NOT EDIT (digest: 508d99c6cac10435d93632adee94a796) *)
 
 This is the INSTALL file for the lustre-v6 distribution.
 
@@ -15,7 +15,7 @@ In order to compile this package, you will need:
 * findlib
 * lutils for executable lus2lic, executable lus2lic.dbg
 * extlib for executable lus2lic, executable lus2lic.dbg
-* rdbg-plugin for library lustre-v6
+* rdbg-plugin (>= 1.51) for library lustre-v6
 
 Installing
 ==========
diff --git a/_oasis b/_oasis
index c4801664..d00d42f7 100644
--- a/_oasis
+++ b/_oasis
@@ -1,6 +1,6 @@
 OASISFormat: 0.4
 Name:        lustre-v6
-Version:     1.642
+Version:     1.643
 Synopsis:    The Lustre V6 Verimag compiler
 Description: This package contains:
              - lus2lic: the (current) name of the compiler (and interpreter via -exec).
@@ -47,8 +47,8 @@ Library "lustre-v6"
   Modules:    Lus2licRun
   Path:       src/
   BuildTools: ocamlbuild 
-  BuildDepends: str,unix,num,rdbg-plugin
+  BuildDepends: str,unix,num,rdbg-plugin (>= 1.51) 
   Install:true
   XMETAEnable: true
-  InternalModules: SocExecValue,SocUtils,Lv6util,Lv6version,Lv6errors,Lxm,Lv6MainArgs,Lv6Verbose,Soc,SocPredef,Lv6Id,SocExecDbg,SocExec,SocExecEvalPredef,Lv6Compile,AstTab,AstTabSymbol,AstInstanciateModel,Lv6parserUtils,AstV6,FilenameExtras,LicTab,LicDump,AstPredef,Lic,AstCore,FreshName,IdSolver,EvalConst,LicEvalConst,LicEvalType,UnifyType,Ast2lic,AstV6Dump,EvalClock,UnifyClock,LicEvalClock,EvalType,LicPrg,LicMetaOp,L2lCheckOutputs,Lv6Misc,L2lRmPoly,L2lExpandMetaOp,L2lSplit,L2lExpandNodes,L2lExpandArrays,L2lCheckLoops,L2lCheckMemSafe,L2lOptimIte,Lv6lexer,Lv6parser,AstRecognizePredef,Lic2soc,Action,ActionsDeps,SocVar,SortActions,SortActionsExpe,L2lCheckKcgKeyWord
+  InternalModules: SocExecValue,SocUtils,Lv6util,Lv6version,Lv6errors,Lxm,Lv6MainArgs,Lv6Verbose,Soc,SocPredef,Lv6Id,SocExecDbg,SocExec,SocExecEvalPredef,Lv6Compile,AstTab,AstTabSymbol,AstInstanciateModel,Lv6parserUtils,AstV6,FilenameExtras,LicTab,LicDump,AstPredef,Lic,AstCore,FreshName,IdSolver,EvalConst,LicEvalConst,LicEvalType,UnifyType,Ast2lic,AstV6Dump,EvalClock,UnifyClock,LicEvalClock,EvalType,LicPrg,LicMetaOp,L2lCheckOutputs,Lv6Misc,L2lRmPoly,L2lExpandMetaOp,L2lSplit,L2lExpandNodes,L2lExpandArrays,L2lCheckLoops,L2lCheckMemSafe,L2lOptimIte,Lv6lexer,Lv6parser,AstRecognizePredef,Lic2soc,Action,ActionsDeps,SocVar,TopoSort,SortActions,SortActionsExpe,L2lCheckKcgKeyWord
 # Comment se passer de cette liste à la Prevert ?
diff --git a/src/lus2licRun.ml b/src/lus2licRun.ml
index 70e106df..fe538688 100644
--- a/src/lus2licRun.ml
+++ b/src/lus2licRun.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 27/01/2016 (at 15:56) by Erwan Jahier> *)
+(* Time-stamp: <modified the 05/02/2016 (at 10:48) by Erwan Jahier> *)
 (*-----------------------------------------------------------------------
 ** Copyright (C) - Verimag.
 *)
@@ -82,7 +82,7 @@ let make argv =
     sl_out
   in
   let step_dbg sl_in ectx cont =
-    let cont2 ctx =
+    let cont2 ectx ctx =
       let sl_out = to_soc_subst ctx soc_outputs in
       ctx_ref := ctx;
       cont sl_out ectx
diff --git a/src/lustre-v6.mldylib b/src/lustre-v6.mldylib
index 42ebdc95..3ae89eca 100644
--- a/src/lustre-v6.mldylib
+++ b/src/lustre-v6.mldylib
@@ -1,5 +1,5 @@
 # OASIS_START
-# DO NOT EDIT (digest: 44750c7b2f24dd0efa7c3a3b8863a4bb)
+# DO NOT EDIT (digest: dbb10b1e67d7883ec20936ed84df7d60)
 Lus2licRun
 SocExecValue
 SocUtils
@@ -58,6 +58,7 @@ Lic2soc
 Action
 ActionsDeps
 SocVar
+TopoSort
 SortActions
 SortActionsExpe
 L2lCheckKcgKeyWord
diff --git a/src/lustre-v6.mllib b/src/lustre-v6.mllib
index 42ebdc95..3ae89eca 100644
--- a/src/lustre-v6.mllib
+++ b/src/lustre-v6.mllib
@@ -1,5 +1,5 @@
 # OASIS_START
-# DO NOT EDIT (digest: 44750c7b2f24dd0efa7c3a3b8863a4bb)
+# DO NOT EDIT (digest: dbb10b1e67d7883ec20936ed84df7d60)
 Lus2licRun
 SocExecValue
 SocUtils
@@ -58,6 +58,7 @@ Lic2soc
 Action
 ActionsDeps
 SocVar
+TopoSort
 SortActions
 SortActionsExpe
 L2lCheckKcgKeyWord
diff --git a/src/lv6version.ml b/src/lv6version.ml
index d535d7fa..8e361096 100644
--- a/src/lv6version.ml
+++ b/src/lv6version.ml
@@ -1,7 +1,7 @@
 (** Automatically generated from Makefile *) 
 let tool = "lus2lic"
 let branch = "master"
-let commit = "642"
-let sha_1 = "196914a31f29b1ebabae08ac5426824865f1d323"
+let commit = "643"
+let sha_1 = "938258cfd5f3ccc35cdc039a1396cf7445326b14"
 let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")")
 let maintainer = "jahier@imag.fr"
diff --git a/src/socExecDbg.ml b/src/socExecDbg.ml
index d4d27c37..799ed039 100644
--- a/src/socExecDbg.ml
+++ b/src/socExecDbg.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 25/01/2016 (at 11:17) by Erwan Jahier> *)
+(* Time-stamp: <modified the 05/02/2016 (at 11:51) by Erwan Jahier> *)
 open Soc
 open Data
 open SocExecValue
@@ -10,9 +10,11 @@ let rec (do_step : Soc.tbl -> Soc.t -> SocExecValue.ctx -> SocExecValue.ctx) =
     let ctx = SocExec.soc_step step soc_tbl soc ctx in
     ctx
 
+
+
 (* exported *)
 let rec (do_step_dbg : Soc.tbl -> Soc.t -> Event.ctx -> SocExecValue.ctx ->
-         (SocExecValue.ctx -> Event.t) -> Event.t) =
+         (Event.ctx -> SocExecValue.ctx -> Event.t) -> Event.t) =
   fun soc_tbl soc ectx ctx cont ->
     (*  XXX un peu exegéré de mettre tout ?*)
 (*     let (datal:Data.subst list) = SocExecValue.substs_to_data_subst ctx.s in *)
@@ -27,11 +29,10 @@ let rec (do_step_dbg : Soc.tbl -> Soc.t -> Event.ctx -> SocExecValue.ctx ->
         Event.ctx_outputs = snd soc.profile;
     } 
     in
-    let cont2 ctx =
-      let enb = Event.incr_nb () in
+    let cont2 ectx ctx =
       { 
         Event.step = ectx.Event.ctx_step;
-        Event.nb = enb;
+        Event.nb = ectx.Event.ctx_nb;
         Event.depth = ectx.Event.ctx_depth;
         Event.kind = Event.Exit;
         Event.lang = "lustre";
@@ -40,13 +41,13 @@ let rec (do_step_dbg : Soc.tbl -> Soc.t -> Event.ctx -> SocExecValue.ctx ->
         Event.outputs = ectx.Event.ctx_outputs;
         Event.sinfo = None;
         Event.data = ectx.Event.ctx_data;
-        Event.next = (fun () -> Event.set_nb enb; cont ctx);
+        Event.next = (fun () -> cont (Event.incr_event_nb ectx) ctx);
         Event.terminate = ectx.Event.ctx_terminate;
       } 
     in
     { 
       Event.step = ectx.Event.ctx_step;
-      Event.nb = (Event.incr_nb ());
+      Event.nb = ectx.Event.ctx_nb;
       Event.depth = ectx.Event.ctx_depth;
       Event.kind = Event.Call;
       Event.lang = "lustre";
@@ -57,8 +58,9 @@ let rec (do_step_dbg : Soc.tbl -> Soc.t -> Event.ctx -> SocExecValue.ctx ->
       Event.data = ectx.Event.ctx_data;
       Event.next = (fun () -> 
         let step = match soc.step with [step] -> step | _ ->  assert false in
+        let ectx = Event.incr_event_nb ectx in
         let ctx = SocExec.soc_step step soc_tbl soc ctx in
-        cont2 ctx
+        cont2 ectx ctx
       );
       Event.terminate = ectx.Event.ctx_terminate;
     }
diff --git a/src/socExecDbg.mli b/src/socExecDbg.mli
index dec3244e..38b137a2 100644
--- a/src/socExecDbg.mli
+++ b/src/socExecDbg.mli
@@ -1,8 +1,8 @@
-(* Time-stamp: <modified the 25/01/2016 (at 11:09) by Erwan Jahier> *)
+(* Time-stamp: <modified the 05/02/2016 (at 10:45) by Erwan Jahier> *)
 
 
 (* The entry points for lus2licRun (i.e., for ltop/ldbg) *)
 val do_step : Soc.tbl -> Soc.t -> SocExecValue.ctx -> SocExecValue.ctx
 
 val do_step_dbg : Soc.tbl -> Soc.t -> Event.ctx -> SocExecValue.ctx ->
-  (SocExecValue.ctx -> Event.t) -> Event.t
+  (Event.ctx -> SocExecValue.ctx -> Event.t) -> Event.t
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index 9b4e6a50..2c38ea40 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,5 +1,5 @@
 ==> lus2lic0.sum <==
-Test Run By jahier on Wed Feb  3 15:16:07 
+Test Run By jahier on Mon Feb  8 14:59:00 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic0 tests ===
@@ -64,7 +64,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
 XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
 
 ==> lus2lic1.sum <==
-Test Run By jahier on Wed Feb  3 15:16:08 
+Test Run By jahier on Mon Feb  8 14:59:00 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic1 tests ===
@@ -396,7 +396,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus  {}
 
 ==> lus2lic2.sum <==
-Test Run By jahier on Wed Feb  3 15:16:23 
+Test Run By jahier on Mon Feb  8 14:59:16 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic2 tests ===
@@ -741,7 +741,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus  {}
 
 ==> lus2lic3.sum <==
-Test Run By jahier on Wed Feb  3 15:17:09 
+Test Run By jahier on Mon Feb  8 14:59:52 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic3 tests ===
@@ -1243,7 +1243,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec}
 PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
 
 ==> lus2lic4.sum <==
-Test Run By jahier on Wed Feb  3 15:17:23 
+Test Run By jahier on Mon Feb  8 15:00:03 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic4 tests ===
@@ -1765,13 +1765,13 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
 ===============================
 # Total number of failures: 23
 lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
-lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 15 seconds
-lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 46 seconds
-lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 14 seconds
-lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 48 seconds
+lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 16 seconds
+lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 35 seconds
+lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 11 seconds
+lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 38 seconds
 * Ref time: 
-0.04user 0.03system 2:03.41elapsed 0%CPU (0avgtext+0avgdata 5200maxresident)k
-0inputs+0outputs (0major+5562minor)pagefaults 0swaps
+0.04user 0.02system 1:41.99elapsed 0%CPU (0avgtext+0avgdata 5160maxresident)k
+32inputs+0outputs (0major+5545minor)pagefaults 0swaps
 * Quick time (-j 4):
-0.05user 0.01system 0:54.40elapsed 0%CPU (0avgtext+0avgdata 5168maxresident)k
-0inputs+0outputs (0major+5581minor)pagefaults 0swaps
+0.04user 0.02system 0:47.60elapsed 0%CPU (0avgtext+0avgdata 5172maxresident)k
+0inputs+0outputs (0major+5576minor)pagefaults 0swaps
-- 
GitLab