@@ -70,17 +70,33 @@ void convert(
7070 case goto_trace_stept::typet::ASSIGNMENT:
7171 case goto_trace_stept::typet::DECL:
7272 {
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 ();
7476 xmlt &xml_assignment=dest.new_element (" assignment" );
7577
7678 if (xml_location.name !=" " )
7779 xml_assignment.new_element ().swap (xml_location);
7880
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 );
8190
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;
84100
85101 if (step.full_lhs .is_not_nil ())
86102 full_lhs_string=from_expr (ns, identifier, step.full_lhs );
@@ -89,43 +105,17 @@ void convert(
89105 full_lhs_value_string=
90106 from_expr (ns, identifier, step.full_lhs_value );
91107
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;
110108 xml_assignment.new_element (" full_lhs" ).data =full_lhs_string;
111109 xml_assignment.new_element (" full_lhs_value" ).data =full_lhs_value_string;
112- xml_assignment.new_element (" value" ).data =value_string;
113110
114111 xml_assignment.set_attribute_bool (" hidden" , step.hidden );
115112 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));
119113 xml_assignment.set_attribute (" step_nr" , std::to_string (step.step_nr ));
120114
121115 xml_assignment.set_attribute (" assignment_type" ,
122116 step.assignment_type ==
123117 goto_trace_stept::assignment_typet::ACTUAL_PARAMETER?
124118 " 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));
129119 }
130120 break ;
131121
0 commit comments