@@ -17,6 +17,7 @@ Author: Daniel Kroening
17
17
#include < ostream>
18
18
19
19
#include < util/arith_tools.h>
20
+ #include < util/format_expr.h>
20
21
#include < util/symbol.h>
21
22
22
23
#include < ansi-c/printf_formatter.h>
@@ -61,61 +62,45 @@ void goto_trace_stept::output(
61
62
UNREACHABLE;
62
63
}
63
64
64
- if (type==typet::ASSERT || type==typet::ASSUME || type==typet::GOTO )
65
+ if (is_assert () || is_assume () || is_goto () )
65
66
out << " (" << cond_value << " )" ;
67
+ else if (is_function_call () || is_function_return ())
68
+ out << ' ' << identifier;
66
69
67
70
if (hidden)
68
71
out << " hidden" ;
69
72
70
- out << " \n " ;
73
+ out << ' \n ' ;
74
+
75
+ if (is_assignment ())
76
+ {
77
+ out << " " << format (full_lhs)
78
+ << " = " << format (full_lhs_value)
79
+ << ' \n ' ;
80
+ }
71
81
72
82
if (!pc->source_location .is_nil ())
73
- out << pc->source_location << " \n " ;
74
-
75
- if (pc->is_goto ())
76
- out << " GOTO " ;
77
- else if (pc->is_assume ())
78
- out << " ASSUME " ;
79
- else if (pc->is_assert ())
80
- out << " ASSERT " ;
81
- else if (pc->is_dead ())
82
- out << " DEAD " ;
83
- else if (pc->is_other ())
84
- out << " OTHER " ;
85
- else if (pc->is_assign ())
86
- out << " ASSIGN " ;
87
- else if (pc->is_decl ())
88
- out << " DECL " ;
89
- else if (pc->is_function_call ())
90
- out << " CALL " ;
91
- else
92
- out << " (?) " ;
83
+ out << pc->source_location << ' \n ' ;
93
84
94
- out << " \n " ;
85
+ out << pc-> type << ' \n ' ;
95
86
96
- if ((pc->is_other () && lhs_object.is_not_nil ()) || pc->is_assign ())
97
- {
98
- irep_idt identifier=lhs_object.get_object_name ();
99
- out << " " << from_expr (ns, identifier, lhs_object.get_original_expr ())
100
- << " = " << from_expr (ns, identifier, lhs_object_value)
101
- << " \n " ;
102
- }
103
- else if (pc->is_assert ())
87
+ if (pc->is_assert ())
104
88
{
105
89
if (!cond_value)
106
90
{
107
- out << " Violated property:" << " \n " ;
91
+ out << " Violated property:" << ' \n ' ;
108
92
if (pc->source_location .is_nil ())
109
- out << " " << pc->source_location << " \n " ;
93
+ out << " " << pc->source_location << ' \n ' ;
110
94
111
- if (comment!=" " )
112
- out << " " << comment << " \n " ;
113
- out << " " << from_expr (ns, pc->function , pc->guard ) << " \n " ;
114
- out << " \n " ;
95
+ if (!comment.empty ())
96
+ out << " " << comment << ' \n ' ;
97
+
98
+ out << " " << format (pc->guard ) << ' \n ' ;
99
+ out << ' \n ' ;
115
100
}
116
101
}
117
102
118
- out << " \n " ;
103
+ out << ' \n ' ;
119
104
}
120
105
121
106
std::string trace_value_binary (
0 commit comments