Add option to invoke callout prior to each instruction #563
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new debugging feature for the
ubpf
virtual machine, allowing a debug function to be registered and invoked before each instruction execution. The most important changes include adding the debug function registration and invocation, updating the VM state structure, and creating a new test to verify this functionality.Debugging Feature Enhancements:
ubpf_debug_fn
and the functionubpf_register_debug_fn
toubpf.h
to allow the registration of a debug function that gets invoked before each instruction. (vm/inc/ubpf.h
)ubpf_vm
structure to include the debug function and its context. (vm/ubpf_int.h
)ubpf_exec_ex
to call the registered debug function before executing each instruction. (vm/ubpf_vm.c
)ubpf_register_debug_fn
function to handle the registration and validation of the debug function. (vm/ubpf_vm.c
)Testing and Documentation:
ubpf_test_debug_function.cc
to verify that the debug function is correctly registered and invoked, capturing the VM state before each instruction. (custom_tests/srcs/ubpf_test_debug_function.cc
)ubpf_test_debug_function.md
to document the purpose and functionality of the new test. (custom_tests/descrs/ubpf_test_debug_function.md
)ubpf_test_debug_function.input
to provide the necessary data for the new test. (custom_tests/data/ubpf_test_debug_function.input
)