DynamoRIO / DynamoRIO/dynamorio

Add automated ground-truth testing of every instruction variation we currently test for internal self-consistency

Open
#3,638 0 comments 0 reactions 1 assignee Claimed by @hgreving2304 View on GitHub
Component-IR Component-Tests Type-Feature
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

Today our api.ir test goes through every opcode and major variation within each opcode and ensures that all our IR components agree with each other: fast decoder, slow decoder, encoder, INSTR_CREATE macros. However, there is no test that we have the right encoding found on the actual processor.

The proposal here is to have api.ir disassemble all of those tests (today done by setting VERBOSE to 1), probably in Intel syntax, and feed it through an external decoder for comparison. This could either be objdump, which is awkward to script for (have to build a binary), or llvm-mc, or capstone. I would propose even pulling capstone into third_party/ since I believe it's pretty small.

We would have to get the syntax to match closely or have some diff fuzzing.

We're already separately adding some tests based on binutils in #3574, but those only test their list of variations. The proposal here should nicely grow organically: any new opcode variation we add will automatically get external validation.

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.