Granary / granary2

Dynamic binary translation framework for instrumenting x86-64 user space Linux programs
MIT License
39 stars 5 forks source link

Make the register trackers have arch-specific implementations. #25

Closed pgoodman closed 10 years ago

pgoodman commented 10 years ago

The register trackers (RegisterTracker, UsedRegisterTracker, LiveRegisterTracker, and DeadRegisterTracker) all use the operand matching interface. I think these could do with arch-specific implementations (for their various Visit methods), as that reduces the internal dependencies on std::function.

Perhaps renaming these set of classes is also in order. I think *RegisterSet is a better name.

pgoodman commented 10 years ago

Also, something about this comment and the following implementation makes me feel like this code might have a bug in it. Worth seeing where the DeadRegisterTracker is used and seeing if the implementation / documentation still makes sense.

pgoodman commented 10 years ago

A good starting place to test any changes are Granary's test cases. To build and run them, do:

make clean test GRANARY_TARGET=test

If all tests pass, then start running Granary on command-line utilities (e.g. ls, grep, gcc, etc.). You can also run Granary on things like VLC, XChat, or SimMud. To run Granary on these programs, try the following:

make clean all
./bin/debug_linux_user/grr -- ls

If you hit anything like a SEGFAULT or something else, let me know and I'll introduce you to the art of debugging a DBT system ;-)

pgoodman commented 10 years ago

This will be resolved in my next commit related to exception handling.