forked from DynamoRIO/dynamorio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i#3544 core, part 1: Use semantic register names
When code uses register names or offsets directly it is hard to follow whether a given register has a special purpose or any scratch register can be used. It also results in IF_<arch>_ELSE ladders which become less readable with each new architecture added. This commit proposes potential solution to this: choose semantic register names and shows several use-cases: 1. core/translate.c: Unit tests for IBL used DR_REG_XCX/R2 directly where TBL_TARGET_SLOT and IBL_TARGET_REG are defined. In such scenarios - replace direct register name with the semantic one to avoid confusion. 2. core/ir/decodelib.c and core/arch/arch.h: Two places utilizing same register fields and requiring synchronization. Instead define semantic name and use it in both places. 3. core/arch/arch.h: According to documentation dr_insert_call() register r11 is clobbered. However this works only because X86 and ARM both have a register named r11. New architectures might not, i.e. RISC-V names registers xN. Instead add a CALL_SCRATCH_REG definition inside arch.h and use this instead. Similarly it seems that if documentation would use semantic names, it would be easier to produce a single table appendix with mapping to concrete registers. Issue: DynamoRIO#3544 Signed-off-by: Stanislaw Kardach <[email protected]>
- Loading branch information
1 parent
c38b3f6
commit 6a49439
Showing
8 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters