Closed archercreat closed 1 year ago
Hey,
yes this is something that is missing. It's been I while that I think about passing an argument as void*
. I will do it as soon as possible (~3 weeks). Meanwhile, an ugly possibility could be to to put your arg in a global variable.
I'll try to make a pull request on weekends, thanks for confirming the issue!
You can use a lambda to capture your custom argument like this:
void my_class::fn()
{
auto get_memory_callback = [this](triton::Context& ctx, const triton::arch::MemoryAccess& mem)
{
};
ctx->addCallback
(
triton::callbacks::GET_CONCRETE_MEMORY_VALUE,
triton::callbacks::getConcreteMemoryValueCallback{ get_memory_callback, &get_memory_callback }
);
}
Hey! Sorry for the long reply, I got sick.. The example that @aris-bb gave is sufficient for me.
I hope you recovered well!
he example that @aris-bb gave is sufficient for me.
Let's close this issue then
Hello! I could not find a way to pass additional arguments to instrumentation callbacks (e.g. get/set concrete memory). Usually I do it with bind:
But bind doesn't work with
addCallback
api. Is there another way to do this?