DynamoRIO / DynamoRIO/dynamorio
Add better support for decoding different ISAs in different standalone tool threads
- 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
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