From 9dd6af0849c898c5aeb81fb7672e8201256af298 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 20 Aug 2018 15:23:25 +0100 Subject: [PATCH] Add evmc_set_tracer helper --- include/evmc/helpers.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/evmc/helpers.h b/include/evmc/helpers.h index 5b3d4f6..24b2c9b 100644 --- a/include/evmc/helpers.h +++ b/include/evmc/helpers.h @@ -41,6 +41,19 @@ static inline int evmc_set_option(struct evmc_instance* instance, return 0; } +/** + * Sets the tracer callback for the VM instance, if the feature is supported by the VM. + * + * @see evmc_set_tracer_fn + */ +static inline void evmc_set_tracer(struct evmc_instance* instance, + evmc_trace_callback callback, + struct evmc_tracer_context* context) +{ + if (instance->set_tracer) + instance->set_tracer(instance, callback, context); +} + /** * Executes code in the VM instance. *