Skip to content

Commit 11b2bd5

Browse files
committed
Add backtrace marks for global initializers
1 parent c4ca481 commit 11b2bd5

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/framework/constraints.ml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ open Goblint_constraint.ConstrSys
99
open GobConfig
1010

1111

12+
type Goblint_backtrace.mark += TfLocation of location
13+
14+
let () = Goblint_backtrace.register_mark_printer (function
15+
| TfLocation loc ->
16+
Some ("transfer function at " ^ CilType.Location.show loc)
17+
| _ -> None (* for other marks *)
18+
)
19+
20+
1221
module type Increment =
1322
sig
1423
val increment: increment_data option
@@ -343,14 +352,6 @@ struct
343352
| Skip -> tf_skip var edge prev_node
344353
end getl sidel demandl getg sideg d
345354

346-
type Goblint_backtrace.mark += TfLocation of location
347-
348-
let () = Goblint_backtrace.register_mark_printer (function
349-
| TfLocation loc ->
350-
Some ("transfer function at " ^ CilType.Location.show loc)
351-
| _ -> None (* for other marks *)
352-
)
353-
354355
let tf var getl sidel demandl getg sideg prev_node (_,edge) d (f,t) =
355356
let old_loc = !Goblint_tracing.current_loc in
356357
let old_loc2 = !Goblint_tracing.next_loc in

src/framework/control.ml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,13 @@ struct
341341
res'
342342
| _ -> failwith "Unsupported global initializer edge"
343343
in
344+
let transfer_func st (loc, edge) =
345+
Goblint_backtrace.protect ~mark:(fun () -> Constraints.TfLocation loc) ~finally:(fun () ->
346+
()
347+
) (fun () ->
348+
transfer_func st (loc, edge)
349+
)
350+
in
344351
let with_externs = do_extern_inits man file in
345352
(*if (get_bool "dbg.verbose") then Printf.printf "Number of init. edges : %d\nWorking:" (List.length edges); *)
346353
let old_loc = !Goblint_tracing.current_loc in

0 commit comments

Comments
 (0)