From 1d60418132460c23b216a2f8a9e0ea8897d32ea4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 9 Jul 2021 19:35:19 +0200 Subject: 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 --- vm.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vm.h') 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))) -- cgit v1.2.3