DynamoRIO / DynamoRIO/dynamorio

Add better support for decoding different ISAs in different standalone tool threads

Open
#6,690 2 comments 0 reactions 0 assignees View on GitHub
Component-API Component-IR
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

As documented at https://dynamorio.org/API_BT.html#sec_isa, each instr_t has its own ISA mode for
encoding. However, for decoding, the dcontext's ISA mode is used, and instandalone mode we have
just the global dcontext which uses a global ISA mode var. Thus, there is not good support for
a standalone tool that wanted to decode multiple ISA modes in separate tool threads.

One possibility would be to honor the ISA mode set in the instr_t passed for decoding, for decoding
routines that take an instr (so this would not help something like decode_sizeof).

Another possibility would be to use toolchain TLS support to create per-thread dcontext_t instances
in standalone mode, which would give us lock-free local heap for non-STATIC_LIBRARY for thread-private
objects.

Contributor guide

Open the contributing guide

Research direction

Start with the ISA documentation at API_BT.html#sec_isa and trace the standalone decoding paths involving instr_t, dcontext_t, and decode_sizeof. Compare the two approaches described—using the instr_t ISA mode or per-thread dcontext_t instances—and clarify their scope and constraints. Done means separate standalone tool threads can decode different ISA modes correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.