Skip to content

Commit

Permalink
logging improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
trou committed Dec 15, 2021
1 parent 8b6f987 commit 6d29cf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ocaml/src/fixpoint/interpreter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct

let res =
List.fold_left (fun l v ->
L.analysis (fun p -> p "examining (%d)" v.Cfa.State.id);
L.debug (fun p -> p "examining (%d)" v.Cfa.State.id);
try
(* filters on cutting instruction pointers *)
if Config.SAddresses.mem (Data.Address.to_int v.Cfa.State.ip) !Config.blackAddresses then
Expand Down Expand Up @@ -126,10 +126,10 @@ struct
Exit -> l
) [] vertices
in
L.analysis (fun p -> p "at filter_vertices: %d new vertices to explore. Before filter: %d vertices" (List.length (res)) (List.length vertices));
L.debug (fun p -> p "at filter_vertices: %d new vertices to explore. Before filter: %d vertices" (List.length (res)) (List.length vertices));
if List.length res > 0 then
begin
List.iter(fun rv -> L.analysis (fun p -> p "remaining vertice to explore: %d" rv.Cfa.State.id) ) res;
List.iter(fun rv -> L.debug (fun p -> p "remaining vertice to explore: %d" rv.Cfa.State.id) ) res;
end;
res

Expand Down
2 changes: 1 addition & 1 deletion ocaml/src/fixpoint/stubs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ module Make(D: Domain.T) = struct


let write _ip _ d ret args =
L.info (fun p -> p "write output");
let fd =
try
Z.to_int (D.value_of_exp d (Asm.Lval (args 0)))
Expand All @@ -375,6 +374,7 @@ module Make(D: Domain.T) = struct
if fd = 1 then
let buf = Asm.Lval (args 1) in
try
L.info (fun p -> p "write(1) output:");
let char_nb = Z.to_int (D.value_of_exp d (Asm.Lval (args 2))) in
let d', len = D.print_chars d buf char_nb None in
let d', taint = D.set ret (Asm.Const (Data.Word.of_int (Z.of_int len) !Config.operand_sz)) d' in
Expand Down

0 comments on commit 6d29cf7

Please sign in to comment.