DynamoRIO / DynamoRIO/dynamorio

Refactor repeated code for creating syscalls in raw2trace and invariant checker tests.

Open
#7,835 0 comments 0 reactions 1 assignee Claimed by @bin-wang View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.