Skip to content

Commit b65c139

Browse files
karkhazmarkrtuttle
andauthored
Use CBMC XML output to enable VSCode debugger (#673)
Prior to this commit, CBMC would emit logging information in plain text format, which does not contain information required for the CBMC VSCode debugger. This commit makes CBMC use XML instead of plain text. Co-authored-by: Mark Tuttle <[email protected]>
1 parent 1615f72 commit b65c139

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

test/cbmc/proofs/Makefile.template

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,38 +119,36 @@ goto:
119119
# Ignore the return code for CBMC, so that we can still generate the
120120
# report if the proof failed. If the proof failed, we separately fail
121121
# the entire job using the check-cbmc-result rule.
122-
cbmc.txt: $(ENTRY).goto
123-
-cbmc $(CBMCFLAGS) $(SOLVER) --unwinding-assertions --trace @RULE_INPUT@ > $@ 2>&1
122+
cbmc.xml: $(ENTRY).goto
123+
-cbmc $(CBMCFLAGS) $(SOLVER) --unwinding-assertions --trace --xml-ui @RULE_INPUT@ > $@ 2>&1
124124

125125
property.xml: $(ENTRY).goto
126126
cbmc $(CBMCFLAGS) --unwinding-assertions --show-properties --xml-ui @RULE_INPUT@ > $@ 2>&1
127127

128128
coverage.xml: $(ENTRY).goto
129129
cbmc $(CBMCFLAGS) --cover location --xml-ui @RULE_INPUT@ > $@ 2>&1
130130

131-
cbmc: cbmc.txt
131+
cbmc: cbmc.xml
132132

133133
property: property.xml
134134

135135
coverage: coverage.xml
136136

137-
report: cbmc.txt property.xml coverage.xml
137+
report: cbmc.xml property.xml coverage.xml
138138
$(VIEWER) \
139139
--goto $(ENTRY).goto \
140140
--srcdir $(FREERTOS_PLUS_TCP) \
141-
--blddir $(FREERTOS_PLUS_TCP) \
142-
--htmldir html \
143-
--srcexclude "(.@FORWARD_SLASH@doc|.@FORWARD_SLASH@tests|.@FORWARD_SLASH@vendors)" \
144-
--result cbmc.txt \
141+
--reportdir report \
142+
--result cbmc.xml \
145143
--property property.xml \
146-
--block coverage.xml
144+
--coverage coverage.xml
147145

148-
# This rule depends only on cbmc.txt and has no dependents, so it will
146+
# This rule depends only on cbmc.xml and has no dependents, so it will
149147
# not block the report from being generated if it fails. This rule is
150148
# intended to fail if and only if the CBMC safety check that emits
151-
# cbmc.txt yielded a proof failure.
152-
check-cbmc-result: cbmc.txt
153-
grep -e "^VERIFICATION SUCCESSFUL" $^
149+
# cbmc.xml yielded a proof failure.
150+
check-cbmc-result: cbmc.xml
151+
grep '<cprover-status>SUCCESS</cprover-status>' $^
154152

155153
# ____________________________________________________________________
156154
# Rules
@@ -160,7 +158,7 @@ check-cbmc-result: cbmc.txt
160158
clean:
161159
@RM@ $(OBJS) $(ENTRY).goto
162160
@RM@ $(ENTRY)[0-9].goto $(ENTRY)[0-9].txt
163-
@RM@ cbmc.txt property.xml coverage.xml TAGS TAGS-*
161+
@RM@ cbmc.xml property.xml coverage.xml TAGS TAGS-*
164162
@RM@ *~ \#*
165163
@RM@ queue_datastructure.h
166164

0 commit comments

Comments
 (0)