Skip to content

Commit 4b94743

Browse files
committed
slicer: add function path to goto-instrument
This commit adds the command line argument handling for the function path slicer. To keep all possible exeuction traces that hit both function a and b, an example invocation could look as follows: goto-instrument --fp-reachability-slice a:b input output Note, any trace that touches only a, but not b, will not be kept in the program.
1 parent 4cc618f commit 4b94743

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,15 @@ void goto_instrument_parse_optionst::instrument_goto_program()
14261426
reachability_slicer(goto_model);
14271427
}
14281428

1429+
if(cmdline.isset("fp-reachability-slice"))
1430+
{
1431+
do_indirect_call_and_rtti_removal();
1432+
1433+
status() << "Performing a function pointer reachability slice" << eom;
1434+
function_path_reachability_slicer(
1435+
goto_model, cmdline.get_values("fp-reachability-slice"));
1436+
}
1437+
14291438
// full slice?
14301439
if(cmdline.isset("full-slice"))
14311440
{
@@ -1606,6 +1615,9 @@ void goto_instrument_parse_optionst::help()
16061615
" --render-cluster-function clusterises the dot by functions\n"
16071616
"\n"
16081617
"Slicing:\n"
1618+
" --fp-reachability-slice <f> remove instructions that cannot appear on a\n" // NOLINT(*)
1619+
" trace that visits all given functions. The list of functions has to be\n" // NOLINT(*)
1620+
" given as a colon separated list.\n"
16091621
" --reachability-slice slice away instructions that can't reach assertions\n" // NOLINT(*)
16101622
" --full-slice slice away instructions that don't affect assertions\n" // NOLINT(*)
16111623
" --property id slice with respect to specific property only\n" // NOLINT(*)

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Author: Daniel Kroening, [email protected]
7171
"(show-struct-alignment)(interval-analysis)(show-intervals)" \
7272
"(show-uninitialized)(show-locations)" \
7373
"(full-slice)(reachability-slice)(slice-global-inits)" \
74+
"(fp-reachability-slice):" \
7475
"(inline)(partial-inline)(function-inline):(log):(no-caching)" \
7576
OPT_REMOVE_CONST_FUNCTION_POINTERS \
7677
"(print-internal-representation)" \

0 commit comments

Comments
 (0)