Skip to content

Commit cda902b

Browse files
nmantheyPetr Bauch
authored and
Petr Bauch
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 dcb663b commit cda902b

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
@@ -1430,6 +1430,15 @@ void goto_instrument_parse_optionst::instrument_goto_program()
14301430
reachability_slicer(goto_model);
14311431
}
14321432

1433+
if(cmdline.isset("fp-reachability-slice"))
1434+
{
1435+
do_indirect_call_and_rtti_removal();
1436+
1437+
status() << "Performing a function pointer reachability slice" << eom;
1438+
function_path_reachability_slicer(
1439+
goto_model, cmdline.get_values("fp-reachability-slice"));
1440+
}
1441+
14331442
// full slice?
14341443
if(cmdline.isset("full-slice"))
14351444
{
@@ -1610,6 +1619,9 @@ void goto_instrument_parse_optionst::help()
16101619
" --render-cluster-function clusterises the dot by functions\n"
16111620
"\n"
16121621
"Slicing:\n"
1622+
" --fp-reachability-slice <f> remove instructions that cannot appear on a\n" // NOLINT(*)
1623+
" trace that visits all given functions. The list of functions has to be\n" // NOLINT(*)
1624+
" given as a colon separated list.\n"
16131625
" --reachability-slice slice away instructions that can't reach assertions\n" // NOLINT(*)
16141626
" --full-slice slice away instructions that don't affect assertions\n" // NOLINT(*)
16151627
" --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)