Skip to content

Commit 6d7269d

Browse files
committed
XML counterexample trace: display member types
Field-sensitive SSA yields assignments at member/element level. The XML counterexamples, however, appeared to (continue to) assume that all assignments take place at object level. Adjust the type (which is only included in XML output, not in JSON nor plain output) to match that of the element being assigned.
1 parent c688efd commit 6d7269d

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

Diff for: doc/assets/xml_spec.xsd

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<xs:complexType>
4040
<xs:all>
4141
<xs:element ref="location" minOccurs="0"/>
42-
<xs:element name="type" type="xs:string" minOccurs="0"/>
42+
<xs:element name="full_lhs_type" type="xs:string" minOccurs="0"/>
4343
<xs:element name="full_lhs" type="xs:string"/>
4444
<xs:element name="full_lhs_value">
4545
<xs:complexType>

Diff for: regression/cbmc/xml-trace/test.desc

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
CORE broken-smt-backend
22
main.c
33
--xml-ui --function test --little-endian
4+
activate-multi-line-match
45
^EXIT=10$
56
^SIGNAL=0$
67
VERIFICATION FAILED
7-
<assignment assignment_type="state" base_name="u" display_name="test::u" hidden="false" identifier="test::u" mode="C" step_nr="\d+" thread="0">
8-
<location file=".*" function="test" line="\d+" working-directory=".*"/>
9-
<type>union myunion</type>
10-
<full_lhs>byte_extract_little_endian\(u, 0ll?, .*int.*\)</full_lhs>
11-
<full_lhs_value binary="[01]+">\d+ll?</full_lhs_value>
12-
<value>\{ \.i=\d+ll? \}</value>
13-
<value_expression>
14-
<union>
15-
<member member_name="i">
16-
<integer binary="\d+" c_type=".*int.*" width="\d+">\d+</integer>
17-
</member>
18-
</union>
19-
</value_expression>
20-
</assignment>
8+
<assignment assignment_type="actual_parameter" base_name="u" display_name="test::u" hidden="false" identifier="test::u" mode="C" step_nr="\d+" thread="0">\n\s*<location file=".*" line="\d+" working-directory=".*"/>\n\s*<full_lhs_type>union myunion</full_lhs_type>\n\s*<full_lhs>u</full_lhs>
9+
<value>\{ \.i=\d+ll? \}</value>\n\s*<value_expression>\n\s*<union>\n\s*<member member_name="i">\n\s*<integer binary="\d+" c_type=".*int.*" width="\d+">\d+</integer>\n\s*</member>\n\s*</union>\n\s*</value_expression>
10+
<assignment assignment_type="state" base_name="u" display_name="test::u" hidden="false" identifier="test::u" mode="C" step_nr="\d+" thread="0">\n\s*<location file=".*" function="test" line="\d+" working-directory=".*"/>\n\s*<full_lhs_type>signed long( long)? int</full_lhs_type>\n\s*<full_lhs>byte_extract_little_endian\(u, 0ll?, .*int.*\)</full_lhs>\n\s*<full_lhs_value binary="[01]+">\d+ll?</full_lhs_value>\n\s*</assignment>
2111
--
2212
^warning: ignoring
2313
--

Diff for: src/goto-programs/xml_goto_trace.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,16 @@ void convert(
140140
lhs_object.has_value() &&
141141
!ns.lookup(lhs_object->get_identifier(), symbol))
142142
{
143-
std::string type_string = from_type(ns, symbol->name, symbol->type);
143+
std::string type_string =
144+
from_type(ns, symbol->name, step.full_lhs.type());
144145

145146
xml_assignment.set_attribute("mode", id2string(symbol->mode));
146147
xml_assignment.set_attribute("identifier", id2string(symbol->name));
147148
xml_assignment.set_attribute(
148149
"base_name", id2string(symbol->base_name));
149150
xml_assignment.set_attribute(
150151
"display_name", id2string(symbol->display_name()));
151-
xml_assignment.new_element("type").data = type_string;
152+
xml_assignment.new_element("full_lhs_type").data = type_string;
152153
}
153154
}
154155

0 commit comments

Comments
 (0)