Skip to content

Callback not triggered when using RepayForward with a step of -1 #27

@dolphinau

Description

@dolphinau

Hi!
Recently, I tried to use the Callback feature of TTD with the bindings of this repo, and I experienced an issue.
It appears that when using a number of steps of -1 in ReplayForward (which is supposed to replay the whole trace), the callbacks aren't triggered.

ttdcursor.SetCallReturnCallback((TTD::PROC_CallCallback)callCallback_tree, 0);
ttdcursor.ReplayForward(&replayrez, last, -1);
// Callback never triggered here

Hence, the only way to scan the whole process and trigger the callbacks at the same time is to ReplayForward with a step of 1 in a loop. This alternative works, but is rather slow.

// Callback triggered here
do {
    ttdcursor.ReplayForward(&replayrez, last, 1);
} while (replayrez.stepCount);

I don't really know if the bug comes from TTD itself or from the bindings. But in the first case, it could be nice to document this behavior in the bindings.

I tried to build an example to understand better the issue, you can find it here, on my fork, in the issue-callback branch.
I hardcoded the value of the trace file and the dlls in the example, you may need to change them to make it work on your machine

I just simplified the example-calltree main file to showcase the bug. I works on windows, and should also work on any other supported platform (but I didn't test).

Thank you for your work on these bindings!
Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions