@@ -71,17 +71,33 @@ void convert(
7171 case goto_trace_stept::typet::ASSIGNMENT:
7272 case goto_trace_stept::typet::DECL:
7373 {
74- irep_idt identifier=step.lhs_object .get_identifier ();
74+ auto lhs_object=step.get_lhs_object ();
75+ irep_idt identifier=
76+ lhs_object.has_value ()?lhs_object->get_identifier ():irep_idt ();
7577 xmlt &xml_assignment=dest.new_element (" assignment" );
7678
7779 if (xml_location.name !=" " )
7880 xml_assignment.new_element ().swap (xml_location);
7981
80- std::string value_string, type_string,
81- full_lhs_string, full_lhs_value_string;
82+ {
83+ auto lhs_object=step.get_lhs_object ();
84+
85+ const symbolt *symbol;
86+
87+ if (lhs_object.has_value () &&
88+ !ns.lookup (lhs_object->get_identifier (), symbol))
89+ {
90+ std::string type_string=from_type (ns, symbol->name , symbol->type );
91+
92+ xml_assignment.set_attribute (" mode" , id2string (symbol->mode ));
93+ xml_assignment.set_attribute (" identifier" , id2string (symbol->name ));
94+ xml_assignment.set_attribute (" base_name" , id2string (symbol->base_name ));
95+ xml_assignment.set_attribute (" display_name" , id2string (symbol->display_name ()));
96+ xml_assignment.new_element (" type" ).data =type_string;
97+ }
98+ }
8299
83- if (step.lhs_object_value .is_not_nil ())
84- value_string=from_expr (ns, identifier, step.lhs_object_value );
100+ std::string full_lhs_string, full_lhs_value_string;
85101
86102 if (step.full_lhs .is_not_nil ())
87103 full_lhs_string=from_expr (ns, identifier, step.full_lhs );
@@ -90,28 +106,11 @@ void convert(
90106 full_lhs_value_string=
91107 from_expr (ns, identifier, step.full_lhs_value );
92108
93- const symbolt *symbol;
94- irep_idt base_name, display_name;
95-
96- if (!ns.lookup (identifier, symbol))
97- {
98- base_name=symbol->base_name ;
99- display_name=symbol->display_name ();
100- if (type_string==" " )
101- type_string=from_type (ns, identifier, symbol->type );
102-
103- xml_assignment.set_attribute (" mode" , id2string (symbol->mode ));
104- }
105-
106- xml_assignment.new_element (" type" ).data =type_string;
107109 xml_assignment.new_element (" full_lhs" ).data =full_lhs_string;
108110 xml_assignment.new_element (" full_lhs_value" ).data =full_lhs_value_string;
109111
110112 xml_assignment.set_attribute_bool (" hidden" , step.hidden );
111113 xml_assignment.set_attribute (" thread" , std::to_string (step.thread_nr ));
112- xml_assignment.set_attribute (" identifier" , id2string (identifier));
113- xml_assignment.set_attribute (" base_name" , id2string (base_name));
114- xml_assignment.set_attribute (" display_name" , id2string (display_name));
115114 xml_assignment.set_attribute (" step_nr" , std::to_string (step.step_nr ));
116115
117116 xml_assignment.set_attribute (" assignment_type" ,
0 commit comments