|
|
@ -102,14 +102,12 @@ module NodesHtml : sig
|
|
|
|
val start_node :
|
|
|
|
val start_node :
|
|
|
|
int -> Location.t -> Procname.t -> Cfg.node list -> Cfg.node list -> Cfg.node list ->
|
|
|
|
int -> Location.t -> Procname.t -> Cfg.node list -> Cfg.node list -> Cfg.node list ->
|
|
|
|
DB.source_file -> bool
|
|
|
|
DB.source_file -> bool
|
|
|
|
val finish_node : int -> DB.source_file -> unit
|
|
|
|
val finish_node : Procname.t -> int -> DB.source_file -> unit
|
|
|
|
end = struct
|
|
|
|
end = struct
|
|
|
|
let log_files = Hashtbl.create 11
|
|
|
|
let log_files = Hashtbl.create 11
|
|
|
|
|
|
|
|
|
|
|
|
let id_to_fname id = "node" ^ string_of_int id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let start_node nodeid loc proc_name preds succs exns source =
|
|
|
|
let start_node nodeid loc proc_name preds succs exns source =
|
|
|
|
let node_fname = id_to_fname nodeid in
|
|
|
|
let node_fname = Io_infer.Html.node_filename proc_name nodeid in
|
|
|
|
let modified = Io_infer.Html.modified_during_analysis source ["nodes"; node_fname] in
|
|
|
|
let modified = Io_infer.Html.modified_during_analysis source ["nodes"; node_fname] in
|
|
|
|
let needs_initialization, (fd, fmt) =
|
|
|
|
let needs_initialization, (fd, fmt) =
|
|
|
|
if modified then
|
|
|
|
if modified then
|
|
|
@ -131,34 +129,49 @@ end = struct
|
|
|
|
(Io_infer.Html.pp_line_link source [".."]) loc.Location.line;
|
|
|
|
(Io_infer.Html.pp_line_link source [".."]) loc.Location.line;
|
|
|
|
F.fprintf fmt "<br>PREDS:@\n";
|
|
|
|
F.fprintf fmt "<br>PREDS:@\n";
|
|
|
|
IList.iter (fun node ->
|
|
|
|
IList.iter (fun node ->
|
|
|
|
Io_infer.Html.pp_node_link [".."] ""
|
|
|
|
Io_infer.Html.pp_node_link
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_preds node) :> int list)
|
|
|
|
[".."]
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_succs node) :> int list)
|
|
|
|
(Cfg.Node.get_proc_name node)
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_exn node) :> int list)
|
|
|
|
~description:""
|
|
|
|
(is_visited proc_name node) false fmt (Cfg.Node.get_id node :> int)) preds;
|
|
|
|
~preds:(IList.map Cfg.Node.get_id (Cfg.Node.get_preds node) :> int list)
|
|
|
|
|
|
|
|
~succs:(IList.map Cfg.Node.get_id (Cfg.Node.get_succs node) :> int list)
|
|
|
|
|
|
|
|
~exn:(IList.map Cfg.Node.get_id (Cfg.Node.get_exn node) :> int list)
|
|
|
|
|
|
|
|
~isvisited:(is_visited proc_name node)
|
|
|
|
|
|
|
|
~isproof:false
|
|
|
|
|
|
|
|
fmt (Cfg.Node.get_id node :> int)) preds;
|
|
|
|
F.fprintf fmt "<br>SUCCS: @\n";
|
|
|
|
F.fprintf fmt "<br>SUCCS: @\n";
|
|
|
|
IList.iter (fun node ->
|
|
|
|
IList.iter (fun node ->
|
|
|
|
Io_infer.Html.pp_node_link [".."] ""
|
|
|
|
Io_infer.Html.pp_node_link
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_preds node) :> int list)
|
|
|
|
[".."]
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_succs node) :> int list)
|
|
|
|
(Cfg.Node.get_proc_name node)
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_exn node) :> int list)
|
|
|
|
~description:""
|
|
|
|
(is_visited proc_name node) false fmt (Cfg.Node.get_id node :> int)) succs;
|
|
|
|
~preds:(IList.map Cfg.Node.get_id (Cfg.Node.get_preds node) :> int list)
|
|
|
|
|
|
|
|
~succs:(IList.map Cfg.Node.get_id (Cfg.Node.get_succs node) :> int list)
|
|
|
|
|
|
|
|
~exn:(IList.map Cfg.Node.get_id (Cfg.Node.get_exn node) :> int list)
|
|
|
|
|
|
|
|
~isvisited:(is_visited proc_name node)
|
|
|
|
|
|
|
|
~isproof:false
|
|
|
|
|
|
|
|
fmt (Cfg.Node.get_id node :> int)) succs;
|
|
|
|
F.fprintf fmt "<br>EXN: @\n";
|
|
|
|
F.fprintf fmt "<br>EXN: @\n";
|
|
|
|
IList.iter (fun node ->
|
|
|
|
IList.iter (fun node ->
|
|
|
|
Io_infer.Html.pp_node_link [".."] ""
|
|
|
|
Io_infer.Html.pp_node_link
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_preds node) :> int list)
|
|
|
|
[".."]
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_succs node) :> int list)
|
|
|
|
(Cfg.Node.get_proc_name node)
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_exn node) :> int list)
|
|
|
|
~description:""
|
|
|
|
(is_visited proc_name node) false fmt (Cfg.Node.get_id node :> int)) exns;
|
|
|
|
~preds:(IList.map Cfg.Node.get_id (Cfg.Node.get_preds node) :> int list)
|
|
|
|
|
|
|
|
~succs:(IList.map Cfg.Node.get_id (Cfg.Node.get_succs node) :> int list)
|
|
|
|
|
|
|
|
~exn:(IList.map Cfg.Node.get_id (Cfg.Node.get_exn node) :> int list)
|
|
|
|
|
|
|
|
~isvisited:(is_visited proc_name node)
|
|
|
|
|
|
|
|
~isproof:false
|
|
|
|
|
|
|
|
fmt (Cfg.Node.get_id node :> int)) exns;
|
|
|
|
F.fprintf fmt "<br>@\n";
|
|
|
|
F.fprintf fmt "<br>@\n";
|
|
|
|
F.pp_print_flush fmt ();
|
|
|
|
F.pp_print_flush fmt ();
|
|
|
|
true
|
|
|
|
true
|
|
|
|
)
|
|
|
|
)
|
|
|
|
else false
|
|
|
|
else false
|
|
|
|
|
|
|
|
|
|
|
|
let finish_node nodeid source =
|
|
|
|
let finish_node proc_name nodeid source =
|
|
|
|
let fname = id_to_fname nodeid in
|
|
|
|
let node_fname = Io_infer.Html.node_filename proc_name nodeid in
|
|
|
|
let fd = Hashtbl.find log_files (fname, source) in
|
|
|
|
let fd = Hashtbl.find log_files (node_fname, source) in
|
|
|
|
Unix.close fd;
|
|
|
|
Unix.close fd;
|
|
|
|
curr_html_formatter := F.std_formatter
|
|
|
|
curr_html_formatter := F.std_formatter
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -393,7 +406,7 @@ let node_finish_session node source =
|
|
|
|
if Config.write_html then begin
|
|
|
|
if Config.write_html then begin
|
|
|
|
F.fprintf !curr_html_formatter "</LISTING>%a"
|
|
|
|
F.fprintf !curr_html_formatter "</LISTING>%a"
|
|
|
|
Io_infer.Html.pp_end_color ();
|
|
|
|
Io_infer.Html.pp_end_color ();
|
|
|
|
NodesHtml.finish_node (Cfg.Node.get_id node :> int) source
|
|
|
|
NodesHtml.finish_node (Cfg.Node.get_proc_name node) (Cfg.Node.get_id node :> int) source
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
(** Write html file for the procedure.
|
|
|
|
(** Write html file for the procedure.
|
|
|
@ -415,12 +428,16 @@ let write_proc_html source whole_seconds pdesc =
|
|
|
|
linenum;
|
|
|
|
linenum;
|
|
|
|
IList.iter
|
|
|
|
IList.iter
|
|
|
|
(fun n ->
|
|
|
|
(fun n ->
|
|
|
|
Io_infer.Html.pp_node_link []
|
|
|
|
Io_infer.Html.pp_node_link
|
|
|
|
(Cfg.Node.get_description (pe_html Black) n)
|
|
|
|
[]
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_preds n) :> int list)
|
|
|
|
(Cfg.Node.get_proc_name n)
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_succs n) :> int list)
|
|
|
|
~description:(Cfg.Node.get_description (pe_html Black) n)
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_exn n) :> int list)
|
|
|
|
~preds:(IList.map Cfg.Node.get_id (Cfg.Node.get_preds n) :> int list)
|
|
|
|
(is_visited pname n) false fmt (Cfg.Node.get_id n :> int))
|
|
|
|
~succs:(IList.map Cfg.Node.get_id (Cfg.Node.get_succs n) :> int list)
|
|
|
|
|
|
|
|
~exn:(IList.map Cfg.Node.get_id (Cfg.Node.get_exn n) :> int list)
|
|
|
|
|
|
|
|
~isvisited:(is_visited pname n)
|
|
|
|
|
|
|
|
~isproof:false
|
|
|
|
|
|
|
|
fmt (Cfg.Node.get_id n :> int))
|
|
|
|
nodes;
|
|
|
|
nodes;
|
|
|
|
(match Specs.get_summary pname with
|
|
|
|
(match Specs.get_summary pname with
|
|
|
|
| None ->
|
|
|
|
| None ->
|
|
|
@ -525,14 +542,14 @@ let write_html_file linereader filename procs =
|
|
|
|
Specs.Visitedset.mem (Cfg.Node.get_id n, []) !proof_cover in
|
|
|
|
Specs.Visitedset.mem (Cfg.Node.get_id n, []) !proof_cover in
|
|
|
|
Io_infer.Html.pp_node_link
|
|
|
|
Io_infer.Html.pp_node_link
|
|
|
|
[fname_encoding]
|
|
|
|
[fname_encoding]
|
|
|
|
(Cfg.Node.get_description (pe_html Black) n)
|
|
|
|
(Cfg.Node.get_proc_name n)
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_preds n) :> int list)
|
|
|
|
~description:(Cfg.Node.get_description (pe_html Black) n)
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_succs n) :> int list)
|
|
|
|
~preds:(IList.map Cfg.Node.get_id (Cfg.Node.get_preds n) :> int list)
|
|
|
|
(IList.map Cfg.Node.get_id (Cfg.Node.get_exn n) :> int list)
|
|
|
|
~succs:(IList.map Cfg.Node.get_id (Cfg.Node.get_succs n) :> int list)
|
|
|
|
(is_visited (Cfg.Procdesc.get_proc_name pdesc) n)
|
|
|
|
~exn:(IList.map Cfg.Node.get_id (Cfg.Node.get_exn n) :> int list)
|
|
|
|
isproof
|
|
|
|
~isvisited:(is_visited (Cfg.Procdesc.get_proc_name pdesc) n)
|
|
|
|
fmt
|
|
|
|
~isproof
|
|
|
|
(Cfg.Node.get_id n :> int))
|
|
|
|
fmt (Cfg.Node.get_id n :> int))
|
|
|
|
nodes_at_linenum;
|
|
|
|
nodes_at_linenum;
|
|
|
|
IList.iter
|
|
|
|
IList.iter
|
|
|
|
(fun (n, _) ->
|
|
|
|
(fun (n, _) ->
|
|
|
|