Skip to content
Snippets Groups Projects
Commit a2dbed43 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Adapt to the new Rdbg Plugin interface.

cf rdbg git 66d01f567940e06eab9a49604663d43c29fdfe01
parent 60aa7368
No related branches found
No related tags found
No related merge requests found
(* Time-stamp: <modified the 21/02/2014 (at 18:08) by Erwan Jahier> *) (* Time-stamp: <modified the 26/03/2014 (at 16:17) by Erwan Jahier> *)
(* generate ocaml glue code that makes it possible to call lus2lic (* generate ocaml glue code that makes it possible to call lus2lic
from ocaml with the current set of arguments (with Lus2licRun.make). from ocaml with the current set of arguments (with Lus2licRun.make).
...@@ -20,16 +20,11 @@ let (f: string array -> Lv6MainArgs.t -> unit) = ...@@ -20,16 +20,11 @@ let (f: string array -> Lv6MainArgs.t -> unit) =
let oc = open_out (outfile) in let oc = open_out (outfile) in
Lv6util.dump_entete oc; Lv6util.dump_entete oc;
Printf.fprintf oc " Printf.fprintf oc "
let inputs, outputs, kill, step, step_dbg, mems_i,mems_o = let plugin =
let args = Array.of_list [%s] in let args = Array.of_list [%s] in
Lus2licRun.make args Lus2licRun.make args
let dyn_file = (Dynlink.adapt_filename \"%s\") let dyn_file = (Dynlink.adapt_filename \"%s\")
let _ = let _ =
OcamlRM.reg_inputs dyn_file inputs; OcamlRM.reg_plugin dyn_file plugin
OcamlRM.reg_outputs dyn_file outputs;
OcamlRM.reg_kill dyn_file kill;
OcamlRM.reg_step dyn_file step;
OcamlRM.reg_step_dbg dyn_file step_dbg;
OcamlRM.reg_mems dyn_file mems_i mems_o
" args_str cma_file " args_str cma_file
(* Time-stamp: <modified the 20/02/2014 (at 11:26) by Erwan Jahier> *) (* Time-stamp: <modified the 26/03/2014 (at 16:12) by Erwan Jahier> *)
(*----------------------------------------------------------------------- (*-----------------------------------------------------------------------
** Copyright (C) - Verimag. ** Copyright (C) - Verimag.
*) *)
...@@ -8,6 +8,7 @@ type vars = (string * Data.t) list ...@@ -8,6 +8,7 @@ type vars = (string * Data.t) list
open Lv6MainArgs open Lv6MainArgs
open Soc open Soc
open SocExecValue open SocExecValue
open RdbgPlugin
let make argv = let make argv =
let opt = Lv6MainArgs.parse argv in let opt = Lv6MainArgs.parse argv in
...@@ -48,19 +49,19 @@ let make argv = ...@@ -48,19 +49,19 @@ let make argv =
let (vntl_i:Data.vntl) = (fst soc.profile) in let (vntl_i:Data.vntl) = (fst soc.profile) in
let (vntl_o:Data.vntl) = (snd soc.profile) in let (vntl_o:Data.vntl) = (snd soc.profile) in
let oc = stdout in let oc = stdout in
(* Lv6util.dump_entete oc; *) (* Lv6util.dump_entete oc; *)
(* RifIO.write_interface oc vntl_i vntl_o None None; *) (* RifIO.write_interface oc vntl_i vntl_o None None; *)
(* RifIO.flush oc; *) (* RifIO.flush oc; *)
let (to_soc_subst : SocExecValue.ctx -> Soc.var list -> Data.subst list) = let (to_soc_subst : SocExecValue.ctx -> Soc.var list -> Data.subst list) =
fun ctx vl -> fun ctx vl ->
(* let sl = List.map (fun var -> fst var, SocExecValue.get_value ctx (Var var)) vl in *) (* let sl = List.map (fun var -> fst var, SocExecValue.get_value ctx (Var var)) vl in *)
let sl = SocExecValue.filter_top_subst ctx.s in let sl = SocExecValue.filter_top_subst ctx.s in
let sl = List.flatten (List.map SocExec.expand_subst sl) in let sl = List.flatten (List.map SocExec.expand_subst sl) in
(* If the order ever matters, I could try the following. : (* If the order ever matters, I could try the following. :
try List.map (fun v -> fst v, try List.map (fun v -> fst v,
List.assoc (fst v) sl) vl with Not_found -> assert false List.assoc (fst v) sl) vl with Not_found -> assert false
*) *)
sl sl
in in
let (add_subst : Data.subst list -> SocExecValue.substs -> SocExecValue.substs) = let (add_subst : Data.subst list -> SocExecValue.substs -> SocExecValue.substs) =
...@@ -74,8 +75,8 @@ let make argv = ...@@ -74,8 +75,8 @@ let make argv =
let ctx = SocExec.do_step soc_tbl soc ctx in let ctx = SocExec.do_step soc_tbl soc ctx in
let sl_out = to_soc_subst ctx soc_outputs in let sl_out = to_soc_subst ctx soc_outputs in
ctx_ref := ctx; ctx_ref := ctx;
(* RifIO.write_outputs oc Util.my_string_of_float vntl_o sl_out; *) (* RifIO.write_outputs oc Util.my_string_of_float vntl_o sl_out; *)
(* RifIO.flush oc; *) (* RifIO.flush oc; *)
sl_out sl_out
in in
let step_dbg sl_in ectx cont = let step_dbg sl_in ectx cont =
...@@ -89,5 +90,12 @@ let make argv = ...@@ -89,5 +90,12 @@ let make argv =
in in
let (mems_in : Data.subst list) = [] in (* XXX todo *) let (mems_in : Data.subst list) = [] in (* XXX todo *)
let (mems_out : Data.subst list) = [] in (* XXX todo *) let (mems_out : Data.subst list) = [] in (* XXX todo *)
vntl_i,vntl_o, (fun _ -> ()), step, step_dbg, mems_in, mems_out {
inputs = vntl_i;
outputs= vntl_o;
kill=(fun _ -> ());
init_inputs=mems_in;
init_outputs=mems_out;
step=step;
step_dbg=step_dbg;
}
(* Time-stamp: <modified the 26/03/2014 (at 16:12) by Erwan Jahier> *)
type vars = (string * Data.t) list val make: string array -> RdbgPlugin.t
val make: string array ->
vars * vars * (string -> unit)
* (Data.subst list -> Data.subst list)
* (Data.subst list -> Event.ctx -> (Data.subst list -> Event.ctx -> Event.t) -> Event.t)
* Data.subst list * Data.subst list
(* type lustre_event = None *)
(* type lustre_event = Eq of string *)
Test Run By jahier on Wed Mar 26 09:48:14 2014 Test Run By jahier on Wed Mar 26 17:22:58 2014
Native configuration is i686-pc-linux-gnu Native configuration is i686-pc-linux-gnu
=== lus2lic tests === === lus2lic tests ===
...@@ -1028,7 +1028,7 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman ...@@ -1028,7 +1028,7 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
# of unexpected failures 74 # of unexpected failures 74
# of unexpected successes 21 # of unexpected successes 21
# of expected failures 37 # of expected failures 37
testcase ./lus2lic.tests/non-reg.exp completed in 106 seconds testcase ./lus2lic.tests/non-reg.exp completed in 105 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds
testcase ./lus2lic.tests/non-reg.exp completed in 106 seconds testcase ./lus2lic.tests/non-reg.exp completed in 105 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds
testcase ./lus2lic.tests/non-reg.exp completed in 106 seconds testcase ./lus2lic.tests/non-reg.exp completed in 105 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment