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

feat: Watchpoints #16

Open
ndrewh opened this issue Jul 8, 2024 · 0 comments
Open

feat: Watchpoints #16

ndrewh opened this issue Jul 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ndrewh
Copy link
Owner

ndrewh commented Jul 8, 2024

We can instrument memory accesses, following the example of https://github.com/DynamoRIO/dynamorio/blob/master/api/samples/memtrace_simple.c.

An initial prototype can be slow, as long as the instrumentation is disabled by default.

I think several optimizations will eventually be necessary.

  • We cannot afford a clean-call all the way out to Python for every memory access. At a minimum, filtering needs to take place in pyda_core -- ideally inline. Users likely only care about a range (or: several ranges) of memory addresses, and our instrumentation should check the address (using in-line instrumentation) so it only performs a clean-call at all if the access is within one of these regions.
  • One potential optimization is to make watched accesses cause a fault (i.e. by changing page protections), and then handling the fault by selectively inserting instrumentation into the block where the fault occurred
@ndrewh ndrewh added the enhancement New feature or request label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant