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

example_calltree fix and more resolved symbols #23

Merged
merged 2 commits into from
Feb 13, 2023

Conversation

xavier-martin
Copy link

No description provided.

endless `ttdcursor.ReplayForward(&replayrez, &end, -1)` seems broken and
PROC_CALLCallback function is eventually not call anymore.
Hacky fix by using ReplayForward with smaller steps.
@commial
Copy link
Owner

commial commented Feb 13, 2023

Hi,
Thanks for the PR.

It indeed seems there is a weird behavior regarding the CallRetCallback when too much instruction are executed in one run. This PR implements a workaround for this issue.

I'm OK to merge it that way, as it fixes the calltree example.
To sum up a few of the tests made:

  • running with a -1 step count is actually using a default stepCount value inside the library
  • at the very end, if there is still n instructions before the trace end, and if we asked stepCount > n in replayForward, the callback is not called (but breakpoints are honored, the number of executed instruction is correct, etc.)
    • the fix implemented here is to "discover" how many instruction is missing until the end of the trace, go back, and ask for exactly n stepCount
  • if stepCount is too big, after m instructions the callback is no more called. This could have been linked the raise of an event unmasked in the trace or something similar, but using several replayForward with less than m instructions correctly works. The working window is also moved if we start later in the trace.
    • The implemented fix is using an empirically working number for stepCount, which seems to be inside the working window

Also, in the future, the PDB fetching should be moved in the lib as an helper (tracked by #9).

As a result, I'm merging it now. Please, do not hesitate to comment if I'm missing a test case here.

@commial commial merged commit fb836bd into commial:master Feb 13, 2023
fengjixuchui added a commit to fengjixuchui/ttd-bindings that referenced this pull request Mar 10, 2023
Merge pull request commial#23 from xavier-martin/master
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

Successfully merging this pull request may close these issues.

3 participants