-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use fm's new matching features for x86 register matching. #1311
Conversation
The user-observable functionality looks great, but I don't feel like I've understood If you are OK with that, then we can proceed. |
Does this mean that |
My understanding is that |
Yes, they are distinct, but the |
Yes, though it's not done by text but by the underlying register: so if r.8.x is |
Ported all remaining tests (including floating point register support) in 8d4a343. Hopefully ready for squashing! |
If @ptersilie is OK with this, I think I am. |
@ptersilie OK to squash? |
Please squash. |
Instead of using concrete register names, one can refer to a class of registers e.g. `r.8` is all 8-bit registers. To match a register name but ignore its value uses `r.8._`: to match a register name use `r.8.x`. Suffixes: must be unique (i.e. `r.8.x` and `r.8.y` must refer to different registers); and they refer to the "underlying" register (e.g. `r.8.x` and `r.64.x` might match `al` and `RAX` which is considered the same register, but will fail to match against `al` and `RBX`). To make this concrete these `assert`s all succeed: ```rust let fmm = fmatcher("r.8.x r.8.y r.64.x"); assert!(fmm.matches("al bl rax").is_ok()); assert!(fmm.matches("al al rax").is_err()); assert!(fmm.matches("al bl rbx").is_err()); assert!(fmm.matches("al bl eax").is_err()); ```
8d4a343
to
adb82e8
Compare
Squashed. |
Instead of using concrete register names, one can refer to a class of registers e.g.
r.8
is all 8-bit registers. To match a register name but ignore its value usesr.8._
: to match a register name user.8.x
. Suffixes: must be unique (i.e.r.8.x
andr.8.y
must refer to different registers); and they refer to the "underlying" register (e.g.r.8.x
andr.64.x
might matchal
andRAX
which is considered the same register, but will fail to match againstal
andRBX
).To make this concrete these
assert
s all succeed:This commit is unfinished in the sense that not all the tests are ported: this is an RFC in its current state. Needs softdevteam/fm#50.