|
|
|
NAME
|
|
|
|
infer-explore - explore the error traces in infer reports
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
infer explore [options]
|
|
|
|
infer explore --procedures [options]
|
|
|
|
infer explore --source-files [options]
|
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
If --procedures is passed, print information about each procedure
|
|
|
|
captured by infer.
|
|
|
|
|
|
|
|
If --source-files is passed, print information about captured source
|
|
|
|
files.
|
|
|
|
|
|
|
|
Otherwise, show the list of bugs on the console and explore symbolic
|
|
|
|
program traces emitted by infer to explain a report. Can also generate
|
|
|
|
an HTML report from a JSON report.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
--help
|
|
|
|
Show this manual
|
|
|
|
|
|
|
|
--help-format { auto | groff | pager | plain }
|
|
|
|
Show this help in the specified format. auto sets the format to
|
|
|
|
plain if the environment variable TERM is "dumb" or undefined, and
|
|
|
|
to pager otherwise.
|
|
|
|
|
|
|
|
--help-full
|
|
|
|
Show this manual with all internal options in the INTERNAL OPTIONS
|
|
|
|
section
|
|
|
|
|
|
|
|
--results-dir,-o dir
|
|
|
|
Write results and internal files in the specified directory
|
|
|
|
EXPLORE BUGS
|
|
|
|
--html
|
|
|
|
Activates: Generate html report. (Conversely: --no-html)
|
|
|
|
|
|
|
|
--max-nesting int
|
|
|
|
Level of nested procedure calls to show. Trace elements beyond the
|
|
|
|
maximum nesting level are skipped. If omitted, all levels are
|
|
|
|
shown.
|
|
|
|
|
|
|
|
--select N
|
|
|
|
Select bug number N. If omitted, prompt for input.
|
|
|
|
|
|
|
|
--no-source-preview
|
|
|
|
Deactivates: print code excerpts around trace elements
|
|
|
|
(Conversely: --source-preview)
|
|
|
|
EXPLORE PROCEDURES
|
|
|
|
--procedures
|
|
|
|
Activates: Print functions and methods discovered by infer
|
|
|
|
(Conversely: --no-procedures)
|
|
|
|
|
|
|
|
--procedures-attributes
|
|
|
|
Activates: Print the attributes of each procedure in the output of
|
|
|
|
--procedures (Conversely: --no-procedures-attributes)
|
|
|
|
|
|
|
|
--no-procedures-definedness
|
|
|
|
Deactivates: Include procedures definedness in the output of
|
|
|
|
--procedures, i.e. whether the procedure definition was found, or
|
|
|
|
only the procedure declaration, or the procedure is an
|
|
|
|
auto-generated Objective-C accessor (Conversely:
|
|
|
|
--procedures-definedness)
|
|
|
|
|
|
|
|
--procedures-filter filter
|
|
|
|
With --procedures, only print functions and methods (procedures)
|
|
|
|
matching the specified filter. A procedure filter is of the form
|
|
|
|
path_pattern:procedure_name. Patterns are interpreted as OCaml Str
|
|
|
|
regular expressions. For instance, to keep only methods named
|
|
|
|
"foo", one can use the filter ".*:foo", or "foo" for short.
|
|
|
|
|
|
|
|
--procedures-name
|
|
|
|
Activates: Include procedures names in the output of --procedures
|
|
|
|
(Conversely: --no-procedures-name)
|
|
|
|
|
|
|
|
--no-procedures-source-file
|
|
|
|
Deactivates: Include the source file in which the procedure
|
|
|
|
definition or declaration was found in the output of --procedures
|
|
|
|
(Conversely: --procedures-source-file)
|
[infer] Add summary-lookup option in infer-explore
Summary:
Problem: `infer report <specs file name>` is called manually sometimes to see analysis results in CLI. However, giving the specs file name is sometimes annoying, because the specs file name may be quite long and include special characters sometimes.
This diff introduces `--procedures-summary` to lookup the summaries interactively in `infer explore`.
example1: There are 8 procedures that include "max" in their names, then I selected one of them by entering a number.
```
$ infer explore --procedures --procedures-filter '.*max.*' --procedures-summary
0: minmax_div_const2_Bad_FN
1: minmax_div_const_Good
2: use_int64_max_Bad
3: use_uint64_max_Good
4: use_int64_max_Good
5: minmax_div_const_Bad
6: minmax_div_const2_Good
7: use_uint64_max_Bad
Select one number (type 'a' for selecting all, 'q' for quit): 2
void use_int64_max_Bad()
Analyzed
ERRORS: BUFFER_OVERRUN_L1
WARNINGS:
FAILURE:NONE SYMOPS:0
BufferOverrunAnalysis: StackLocs: { } MemPure: { } Alias: { ret= }
BufferOverrunChecker: Safety conditions:
{ }
```
example2: If there is only one specs file that satisfies the given filter, it reports the summary of that procedure without an interaction.
```
$ infer explore --procedures --procedures-filter '.*add_in_loop_ok.*' --procedures-summary
Selected proc name: void ArrayListTest.add_in_loop_ok()
void void ArrayListTest.add_in_loop_ok()(ArrayListTest* this)
Analyzed
ERRORS:
WARNINGS:
FAILURE:NONE SYMOPS:0
BufferOverrunAnalysis: StackLocs: { } MemPure: { } Alias:
{ i=size(__new-390022197-0-1.elements), ret= }
LatestPrune: latest { i -> (5, { }, { }) by ((5, { }, { }) >= (5, { }, { })),
__new-390022197-0-1.elements -> (⊥, { }, { __new-390022197-1-1 -> length : 5 }) by ((5, { }, { }) >= (5, { }, { })) }
BufferOverrunChecker: Safety conditions:
{ }
```
Reviewed By: jvillard
Differential Revision: D20284052
fbshipit-source-id: 2131339f1
5 years ago
|
|
|
|
|
|
|
--procedures-summary
|
|
|
|
Activates: Print the summaries of each procedure in the output of
|
|
|
|
--procedures (Conversely: --no-procedures-summary)
|
|
|
|
EXPLORE SOURCE FILES
|
|
|
|
--source-files
|
|
|
|
Activates: Print source files discovered by infer (Conversely:
|
|
|
|
--no-source-files)
|
|
|
|
|
|
|
|
--source-files-cfg
|
|
|
|
Activates: Output a dotty file in infer-out/captured for each
|
|
|
|
source file in the output of --source-files (Conversely:
|
|
|
|
--no-source-files-cfg)
|
|
|
|
|
|
|
|
--source-files-filter filter
|
|
|
|
With --source-files, only print source files matching the
|
|
|
|
specified filter. The filter is a pattern that should match the
|
|
|
|
file path. Patterns are interpreted as OCaml Str regular
|
|
|
|
expressions.
|
|
|
|
|
|
|
|
--source-files-freshly-captured
|
|
|
|
Activates: Print whether the source file has been captured in the
|
|
|
|
most recent capture phase in the output of --source-files.
|
|
|
|
(Conversely: --no-source-files-freshly-captured)
|
|
|
|
|
|
|
|
--source-files-procedure-names
|
|
|
|
Activates: Print the names of procedure of each source file in the
|
|
|
|
output of --source-files (Conversely:
|
|
|
|
--no-source-files-procedure-names)
|
|
|
|
|
|
|
|
--source-files-type-environment
|
|
|
|
Activates: Print the type environment of each source file in the
|
|
|
|
output of --source-files (Conversely:
|
|
|
|
--no-source-files-type-environment)
|
|
|
|
|
|
|
|
|
|
|
|
ENVIRONMENT
|
|
|
|
INFER_ARGS, INFERCONFIG, INFER_STRICT_MODE
|
|
|
|
See the ENVIRONMENT section in the manual of infer(1).
|
|
|
|
|
|
|
|
FILES
|
|
|
|
.inferconfig
|
|
|
|
See the FILES section in the manual of infer(1).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
infer-report(1), infer-run(1)
|
|
|
|
|
|
|
|
|
|
|
|
|