summaryrefslogtreecommitdiffhomepage
path: root/vm.h
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-07-09 19:35:19 +0200
committerJo-Philipp Wich <jo@mein.io>2021-07-11 15:49:14 +0200
commit1d60418132460c23b216a2f8a9e0ea8897d32ea4 (patch)
treefe1640e8d9b2f2a00f9113c971c86a7c5eb28fcd /vm.h
parent48f33ad70bf584a97a2e2d3870b04bbc970194b7 (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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm.h b/vm.h
index 84b42fe..3d22105 100644
--- a/vm.h
+++ b/vm.h
@@ -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)))