diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-07-09 19:35:19 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-07-11 15:49:14 +0200 |
commit | 1d60418132460c23b216a2f8a9e0ea8897d32ea4 (patch) | |
tree | fe1640e8d9b2f2a00f9113c971c86a7c5eb28fcd /vm.h | |
parent | 48f33ad70bf584a97a2e2d3870b04bbc970194b7 (diff) |
vm: add API to control trace mode
Add a public getter and setter to read and set the VM trace level
respectively. Use the new API to control the trace mode with a newly
introduced `-t` command line switch.
Drop support for honouring the `TRACE` environment variable as
host programs embedding ucode might want to prevent that behaviour
or handle it differently.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'vm.h')
-rw-r--r-- | vm.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -123,6 +123,9 @@ uc_value_t *uc_vm_stack_peek(uc_vm *vm, size_t offset); uc_exception_handler_t *uc_vm_exception_handler_get(uc_vm *vm); void uc_vm_exception_handler_set(uc_vm *vm, uc_exception_handler_t *exhandler); +uint32_t uc_vm_trace_get(uc_vm *vm); +void uc_vm_trace_set(uc_vm *vm, uint32_t level); + uc_exception_type_t uc_vm_call(uc_vm *vm, bool mcall, size_t nargs); void __attribute__((format(printf, 3, 0))) |