@@ -178,7 +178,7 @@ void machineExecutionConfigSetMaxGas(CMachineExecutionConfig* c,
178
178
assert (c);
179
179
auto config = static_cast <MachineExecutionConfig*>(c);
180
180
config->max_gas = max_gas;
181
- config->go_over_gas = go_over_gas;
181
+ config->go_over_gas = go_over_gas != 0 ;
182
182
}
183
183
184
184
void machineExecutionConfigSetInboxMessages (CMachineExecutionConfig* c,
@@ -199,14 +199,20 @@ void machineExecutionConfigSetStopOnSideload(CMachineExecutionConfig* c,
199
199
int stop_on_sideload) {
200
200
assert (c);
201
201
auto config = static_cast <MachineExecutionConfig*>(c);
202
- config->stop_on_sideload = stop_on_sideload;
202
+ config->stop_on_sideload = stop_on_sideload != 0 ;
203
203
}
204
204
205
205
void machineExecutionConfigSetStopOnBreakpoint (CMachineExecutionConfig* c,
206
206
int stop_on_breakpoint) {
207
207
assert (c);
208
208
auto config = static_cast <MachineExecutionConfig*>(c);
209
- config->stop_on_breakpoint = stop_on_breakpoint;
209
+ config->stop_on_breakpoint = stop_on_breakpoint != 0 ;
210
+ }
211
+
212
+ void machineExecutionConfigSetTrace (CMachineExecutionConfig* c, int trace) {
213
+ assert (c);
214
+ auto config = static_cast <MachineExecutionConfig*>(c);
215
+ config->trace = trace != 0 ;
210
216
}
211
217
212
218
RawAssertionResult executeAssertion (CMachine* m,
@@ -240,8 +246,12 @@ RawAssertionResult executeAssertion(CMachine* m,
240
246
}
241
247
242
248
std::vector<unsigned char > debugPrintData;
243
- for (const auto & debugPrint : assertion.debug_prints ) {
244
- marshal_value (debugPrint.val , debugPrintData, nullptr );
249
+ int debugPrintDataCount = 0 ;
250
+ if (config->trace ) {
251
+ for (const auto & debugPrint : assertion.debug_prints ) {
252
+ debugPrintDataCount++;
253
+ marshal_value (debugPrint.val , debugPrintData, nullptr );
254
+ }
245
255
}
246
256
247
257
// TODO extend usage of uint256
@@ -250,8 +260,7 @@ RawAssertionResult executeAssertion(CMachine* m,
250
260
returnCharVector (sendData),
251
261
static_cast <int >(assertion.sends .size ()),
252
262
returnCharVector (logData), static_cast <int >(assertion.logs .size ()),
253
- returnCharVector (debugPrintData),
254
- static_cast <int >(assertion.debug_prints .size ()),
263
+ returnCharVector (debugPrintData), debugPrintDataCount,
255
264
intx::narrow_cast<uint64_t >(assertion.step_count ),
256
265
intx::narrow_cast<uint64_t >(assertion.gas_count )},
257
266
false };
0 commit comments