DynamoRIO / DynamoRIO/dynamorio
Refactor repeated code for creating syscalls in raw2trace and invariant checker tests.
Open
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 30
Description
Because the syscall instruction differs by the platform, currently the following code are repeated multiple times in raw2trace_unit_tests.cpp and invariant_checker_test.cpp
```
# ifdef X86
instr_t *sys = INSTR_CREATE_syscall(GLOBAL_DCONTEXT);
# elif defined(AARCHXX)
instr_t *sys =
INSTR_CREATE_svc(GLOBAL_DCONTEXT, opnd_create_immed_int((sbyte)0x0, OPSZ_1));
# elif defined(RISCV64)
instr_t *sys = INSTR_CREATE_ecall(GLOBAL_DCONTEXT);
# else
# error Unsupported architecture.
# endif
```
We should refactor this by introducing a macro or helper function.
Contributor guide
Assessment
This issue has not been assessed yet.