diff options
author | David Malcolm <dmalcolm@redhat.com> | 2021-07-16 15:47:06 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2021-07-16 15:47:06 -0400 |
commit | 9ea10c480565fa42b1804fb436f7e26ca77b71a3 (patch) | |
tree | 06cc69c3752438b1cdccfa134b6e763d9a1ad303 /gcc/doc | |
parent | 5932dd35eaa816e8d9b6406c6c433395ff5b6162 (diff) | |
download | gcc-9ea10c480565fa42b1804fb436f7e26ca77b71a3.zip gcc-9ea10c480565fa42b1804fb436f7e26ca77b71a3.tar.gz gcc-9ea10c480565fa42b1804fb436f7e26ca77b71a3.tar.bz2 |
analyzer: add __analyzer_dump_state
gcc/analyzer/ChangeLog:
* engine.cc (exploded_node::on_stmt_pre): Handle
__analyzer_dump_state.
* program-state.cc (extrinsic_state::get_sm_idx_by_name): New.
(program_state::impl_call_analyzer_dump_state): New.
* program-state.h (extrinsic_state::get_sm_idx_by_name): New decl.
(program_state::impl_call_analyzer_dump_state): New decl.
* region-model-impl-calls.cc
(call_details::get_arg_string_literal): New.
* region-model.h (call_details::get_arg_string_literal): New decl.
gcc/ChangeLog:
* doc/analyzer.texi: Add __analyzer_dump_state.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/analyzer-decls.h (__analyzer_dump_state): New.
* gcc.dg/analyzer/dump-state.c: New test.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/analyzer.texi | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/doc/analyzer.texi b/gcc/doc/analyzer.texi index 2ca4bf6..aadb0de 100644 --- a/gcc/doc/analyzer.texi +++ b/gcc/doc/analyzer.texi @@ -522,6 +522,15 @@ it will also dump all of the states within the ``processed'' nodes. will dump the region_model's state to stderr. @smallexample +__analyzer_dump_state ("malloc", ptr); +@end smallexample + +will emit a warning describing the state of the 2nd argument +(which can be of any type) with respect to the state machine with +a name matching the 1st argument (which must be a string literal). +This is for use when debugging, and may be of use in DejaGnu tests. + +@smallexample __analyzer_eval (expr); @end smallexample will emit a warning with text "TRUE", FALSE" or "UNKNOWN" based on the |