Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
atxr opened this issue May 2, 2023 · 1 comment
Open

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

atxr opened this issue May 2, 2023 · 1 comment

Comments

@atxr
Copy link

atxr commented May 2, 2023

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

@kweatherman
Copy link

Try it without an index file. Delete the ".idx" file that WinDbgX makes.
Assuming you have loaded the trace in WinDbgX in the first place.
I had a similar problem but only when a companion ".idx" file is present. The Windows playback will load the index file along with the ".run" trace file and there is no option to disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants