Skip to content

Commit b0fce60

Browse files
committed
Print (at debug level) the size of assignments during symex
1 parent e515f26 commit b0fce60

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

src/goto-symex/symex_assign.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Author: Daniel Kroening, [email protected]
1212
#include "goto_symex.h"
1313

1414
#include <util/byte_operators.h>
15-
#include <util/cprover_prefix.h>
16-
1715
#include <util/c_types.h>
16+
#include <util/cprover_prefix.h>
17+
#include <util/pointer_offset_size.h>
1818

1919
#include "goto_symex_state.h"
2020

@@ -251,6 +251,14 @@ void goto_symext::symex_assign_symbol(
251251
if(symbol.is_auxiliary)
252252
assignment_type=symex_targett::assignment_typet::HIDDEN;
253253

254+
log.conditional_output(
255+
log.debug(),
256+
[this, &ssa_lhs](messaget::mstreamt &mstream) {
257+
mstream << "Assignment to " << ssa_lhs.get_identifier()
258+
<< " [" << pointer_offset_bits(ssa_lhs.type(), ns) << " bits]"
259+
<< messaget::eom;
260+
});
261+
254262
target.assignment(
255263
tmp_guard.as_expr(),
256264
ssa_lhs,

src/goto-symex/symex_goto.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
1414
#include <algorithm>
1515

1616
#include <util/invariant.h>
17+
#include <util/pointer_offset_size.h>
1718
#include <util/std_expr.h>
1819

1920
#include <analyses/dirty.h>
@@ -249,6 +250,14 @@ void goto_symext::symex_goto(statet &state)
249250

250251
guardt guard;
251252

253+
log.conditional_output(
254+
log.debug(),
255+
[this, &new_lhs](messaget::mstreamt &mstream) {
256+
mstream << "Assignment to " << new_lhs.get_identifier()
257+
<< " [" << pointer_offset_bits(new_lhs.type(), ns) << " bits]"
258+
<< messaget::eom;
259+
});
260+
252261
target.assignment(
253262
guard.as_expr(),
254263
new_lhs, new_lhs, guard_symbol_expr,
@@ -473,6 +482,14 @@ void goto_symext::phi_function(
473482
dest_state.assignment(new_lhs, rhs, ns, true, true);
474483
dest_state.record_events=record_events;
475484

485+
log.conditional_output(
486+
log.debug(),
487+
[this, &new_lhs](messaget::mstreamt &mstream) {
488+
mstream << "Assignment to " << new_lhs.get_identifier()
489+
<< " [" << pointer_offset_bits(new_lhs.type(), ns) << " bits]"
490+
<< messaget::eom;
491+
});
492+
476493
target.assignment(
477494
true_exprt(),
478495
new_lhs, new_lhs, new_lhs.get_original_expr(),

0 commit comments

Comments
 (0)