Skip to content

Commit

Permalink
Tracing API
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jun 5, 2018
1 parent 6743fb9 commit 9505981
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions include/evmc/evmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,26 @@ typedef struct evmc_result (*evmc_execute_fn)(struct evmc_instance* instance,
size_t code_size);


struct evmc_tracer_context;

typedef void (*evmc_trace_callback)(struct evmc_tracer_context* context,
int depth,
int step,
size_t code_offset,
enum evmc_status_code status_code,
int64_t gas_left,
size_t stack_num_items,
const struct evmc_uint256be* pushed_stack_item,
size_t memory_size,
size_t changed_memory_offset,
size_t changed_memory_size,
const uint8_t* changed_memory);

typedef void (*evmc_set_tracer)(struct evmc_instance* instance,
evmc_trace_callback callback,
struct evmc_tracer_context* context);


/**
* The EVM instance.
*
Expand Down Expand Up @@ -720,6 +740,8 @@ struct evmc_instance
/** Pointer to function executing a code by the EVM instance. */
evmc_execute_fn execute;

evmc_set_tracer set_tracer;

/**
* Optional pointer to function modifying VM's options.
*
Expand Down

0 comments on commit 9505981

Please sign in to comment.