Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use fm's new matching features for x86 register matching.
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()); ```
- Loading branch information