Skip to content

Commit 84adc25

Browse files
author
Peter Schrammel
committed
structured values in json traces
1 parent ab4b49d commit 84adc25

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/goto-programs/json_goto_trace.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,19 @@ void convert(
8989
if(!json_location.is_null())
9090
json_assignment["sourceLocation"]=json_location;
9191

92-
std::string value_string, binary_string, type_string,
93-
full_lhs_string, full_lhs_value_string;
94-
95-
//if(it.lhs_object_value.is_not_nil())
96-
// value_string=from_expr(ns, identifier, it.lhs_object_value);
92+
std::string value_string, binary_string, type_string, full_lhs_string;
93+
json_objectt full_lhs_value;
9794

9895
if(it.full_lhs.is_not_nil())
9996
full_lhs_string=from_expr(ns, identifier, it.full_lhs);
10097

98+
#if 0
10199
if(it.full_lhs_value.is_not_nil())
102100
full_lhs_value_string=from_expr(ns, identifier, it.full_lhs_value);
101+
#endif
103102

104-
//if(it.lhs_object_value.type().is_not_nil())
105-
// type_string=from_type(ns, identifier, it.lhs_object_value.type());
103+
if(it.full_lhs_value.is_not_nil())
104+
full_lhs_value = json(it.full_lhs_value, ns);
106105

107106
const symbolt *symbol;
108107
irep_idt base_name, display_name;
@@ -117,7 +116,7 @@ void convert(
117116
json_assignment["mode"]=json_stringt(id2string(symbol->mode));
118117
}
119118

120-
json_assignment["value"]=json_stringt(full_lhs_value_string);
119+
json_assignment["value"]=full_lhs_value;
121120
json_assignment["lhs"]=json_stringt(full_lhs_string);
122121
json_assignment["hidden"]=jsont::json_boolean(it.hidden);
123122
json_assignment["thread"]=json_numbert(i2string(it.thread_nr));
@@ -144,8 +143,7 @@ void convert(
144143
if(l_it.is_nil())
145144
json_values.push_back(json_stringt(""));
146145
else
147-
json_values.push_back(
148-
json_stringt(from_expr(ns, "", l_it)));
146+
json_values.push_back(json(l_it, ns));
149147
}
150148

151149
if(!json_location.is_null())
@@ -169,8 +167,7 @@ void convert(
169167
if(l_it.is_nil())
170168
json_values.push_back(json_stringt(""));
171169
else
172-
json_values.push_back(
173-
json_stringt(from_expr(ns, "", l_it)));
170+
json_values.push_back(json(l_it, ns));
174171
}
175172

176173
if(!json_location.is_null())

0 commit comments

Comments
 (0)