forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make goto_symext a subtype of messaget
to enable debug(), status() etc. output from goto_symext.
- Loading branch information
Showing
19 changed files
with
231 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,15 @@ Author: Daniel Kroening, [email protected] | |
#include <util/simplify_expr.h> | ||
|
||
symex_bmct::symex_bmct( | ||
message_handlert &mh, | ||
const namespacet &_ns, | ||
symbol_tablet &_new_symbol_table, | ||
symex_targett &_target): | ||
goto_symext(_ns, _new_symbol_table, _target), | ||
record_coverage(false), | ||
max_unwind(0), | ||
max_unwind_is_set(false), | ||
symex_coverage(_ns) | ||
symex_targett &_target) | ||
: goto_symext(mh, _ns, _new_symbol_table, _target), | ||
record_coverage(false), | ||
max_unwind(0), | ||
max_unwind_is_set(false), | ||
symex_coverage(_ns) | ||
{ | ||
} | ||
|
||
|
@@ -37,10 +38,9 @@ void symex_bmct::symex_step( | |
|
||
if(!source_location.is_nil() && last_source_location!=source_location) | ||
{ | ||
debug() << "BMC at file " << source_location.get_file() | ||
<< " line " << source_location.get_line() | ||
<< " function " << source_location.get_function() | ||
<< eom; | ||
log.debug() << "BMC at file " << source_location.get_file() << " line " | ||
<< source_location.get_line() << " function " | ||
<< source_location.get_function() << log.eom; | ||
|
||
last_source_location=source_location; | ||
} | ||
|
@@ -52,15 +52,15 @@ void symex_bmct::symex_step( | |
state.source.pc->is_assume() && | ||
simplify_expr(state.source.pc->guard, ns).is_false()) | ||
{ | ||
statistics() << "aborting path on assume(false) at " | ||
<< state.source.pc->source_location | ||
<< " thread " << state.source.thread_nr; | ||
log.statistics() << "aborting path on assume(false) at " | ||
<< state.source.pc->source_location << " thread " | ||
<< state.source.thread_nr; | ||
|
||
const irep_idt &c=state.source.pc->source_location.get_comment(); | ||
if(!c.empty()) | ||
statistics() << ": " << c; | ||
log.statistics() << ": " << c; | ||
|
||
statistics() << eom; | ||
log.statistics() << log.eom; | ||
} | ||
|
||
goto_symext::symex_step(goto_functions, state); | ||
|
@@ -94,7 +94,7 @@ void symex_bmct::merge_goto( | |
|
||
goto_symext::merge_goto(goto_state, state); | ||
|
||
assert(prev_pc->is_goto()); | ||
PRECONDITION(prev_pc->is_goto()); | ||
if(record_coverage && | ||
// could the branch possibly be taken? | ||
!prev_guard.is_false() && | ||
|
@@ -132,15 +132,14 @@ bool symex_bmct::get_unwind( | |
|
||
bool abort=unwind>=this_loop_limit; | ||
|
||
statistics() << (abort?"Not unwinding":"Unwinding") | ||
<< " loop " << id << " iteration " | ||
<< unwind; | ||
log.statistics() << (abort ? "Not unwinding" : "Unwinding") << " loop " << id | ||
<< " iteration " << unwind; | ||
|
||
if(this_loop_limit!=std::numeric_limits<unsigned>::max()) | ||
statistics() << " (" << this_loop_limit << " max)"; | ||
log.statistics() << " (" << this_loop_limit << " max)"; | ||
|
||
statistics() << " " << source.pc->source_location | ||
<< " thread " << source.thread_nr << eom; | ||
log.statistics() << " " << source.pc->source_location << " thread " | ||
<< source.thread_nr << log.eom; | ||
|
||
return abort; | ||
} | ||
|
@@ -176,15 +175,13 @@ bool symex_bmct::get_unwind_recursion( | |
{ | ||
const symbolt &symbol=ns.lookup(id); | ||
|
||
statistics() << (abort?"Not unwinding":"Unwinding") | ||
<< " recursion " | ||
<< symbol.display_name() | ||
<< " iteration " << unwind; | ||
log.statistics() << (abort ? "Not unwinding" : "Unwinding") << " recursion " | ||
<< symbol.display_name() << " iteration " << unwind; | ||
|
||
if(this_loop_limit!=std::numeric_limits<unsigned>::max()) | ||
statistics() << " (" << this_loop_limit << " max)"; | ||
log.statistics() << " (" << this_loop_limit << " max)"; | ||
|
||
statistics() << eom; | ||
log.statistics() << log.eom; | ||
} | ||
|
||
return abort; | ||
|
@@ -194,7 +191,7 @@ void symex_bmct::no_body(const irep_idt &identifier) | |
{ | ||
if(body_warnings.insert(identifier).second) | ||
{ | ||
warning() << | ||
"**** WARNING: no body for function " << identifier << eom; | ||
log.warning() << "**** WARNING: no body for function " << identifier | ||
<< log.eom; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,11 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "symex_coverage.h" | ||
|
||
class symex_bmct: | ||
public goto_symext, | ||
public messaget | ||
class symex_bmct: public goto_symext | ||
{ | ||
public: | ||
symex_bmct( | ||
message_handlert &mh, | ||
const namespacet &_ns, | ||
symbol_tablet &_new_symbol_table, | ||
symex_targett &_target); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.