@@ -70,17 +70,33 @@ void convert(
70
70
case goto_trace_stept::typet::ASSIGNMENT:
71
71
case goto_trace_stept::typet::DECL:
72
72
{
73
- irep_idt identifier=step.lhs_object .get_identifier ();
73
+ auto lhs_object=step.get_lhs_object ();
74
+ irep_idt identifier=
75
+ lhs_object.has_value ()?lhs_object->get_identifier ():irep_idt ();
74
76
xmlt &xml_assignment=dest.new_element (" assignment" );
75
77
76
78
if (xml_location.name !=" " )
77
79
xml_assignment.new_element ().swap (xml_location);
78
80
79
- std::string value_string, binary_string, type_string,
80
- full_lhs_string, full_lhs_value_string;
81
+ {
82
+ auto lhs_object=step.get_lhs_object ();
83
+
84
+ const symbolt *symbol;
85
+
86
+ if (lhs_object.has_value () &&
87
+ !ns.lookup (lhs_object->get_identifier (), symbol))
88
+ {
89
+ std::string type_string=from_type (ns, symbol->name , symbol->type );
81
90
82
- if (step.lhs_object_value .is_not_nil ())
83
- value_string=from_expr (ns, identifier, step.lhs_object_value );
91
+ xml_assignment.set_attribute (" mode" , id2string (symbol->mode ));
92
+ xml_assignment.set_attribute (" identifier" , id2string (symbol->name ));
93
+ xml_assignment.set_attribute (" base_name" , id2string (symbol->base_name ));
94
+ xml_assignment.set_attribute (" display_name" , id2string (symbol->display_name ()));
95
+ xml_assignment.new_element (" type" ).data =type_string;
96
+ }
97
+ }
98
+
99
+ std::string full_lhs_string, full_lhs_value_string;
84
100
85
101
if (step.full_lhs .is_not_nil ())
86
102
full_lhs_string=from_expr (ns, identifier, step.full_lhs );
@@ -89,43 +105,17 @@ void convert(
89
105
full_lhs_value_string=
90
106
from_expr (ns, identifier, step.full_lhs_value );
91
107
92
- if (step.lhs_object_value .type ().is_not_nil ())
93
- type_string=
94
- from_type (ns, identifier, step.lhs_object_value .type ());
95
-
96
- const symbolt *symbol;
97
- irep_idt base_name, display_name;
98
-
99
- if (!ns.lookup (identifier, symbol))
100
- {
101
- base_name=symbol->base_name ;
102
- display_name=symbol->display_name ();
103
- if (type_string==" " )
104
- type_string=from_type (ns, identifier, symbol->type );
105
-
106
- xml_assignment.set_attribute (" mode" , id2string (symbol->mode ));
107
- }
108
-
109
- xml_assignment.new_element (" type" ).data =type_string;
110
108
xml_assignment.new_element (" full_lhs" ).data =full_lhs_string;
111
109
xml_assignment.new_element (" full_lhs_value" ).data =full_lhs_value_string;
112
- xml_assignment.new_element (" value" ).data =value_string;
113
110
114
111
xml_assignment.set_attribute_bool (" hidden" , step.hidden );
115
112
xml_assignment.set_attribute (" thread" , std::to_string (step.thread_nr ));
116
- xml_assignment.set_attribute (" identifier" , id2string (identifier));
117
- xml_assignment.set_attribute (" base_name" , id2string (base_name));
118
- xml_assignment.set_attribute (" display_name" , id2string (display_name));
119
113
xml_assignment.set_attribute (" step_nr" , std::to_string (step.step_nr ));
120
114
121
115
xml_assignment.set_attribute (" assignment_type" ,
122
116
step.assignment_type ==
123
117
goto_trace_stept::assignment_typet::ACTUAL_PARAMETER?
124
118
" actual_parameter" :" state" );
125
-
126
- if (step.lhs_object_value .is_not_nil ())
127
- xml_assignment.new_element (" value_expression" ).
128
- new_element (xml (step.lhs_object_value , ns));
129
119
}
130
120
break ;
131
121
0 commit comments