i#38 attach: Enable attach on AArch64 #5460
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements missing functionality for ptrace attach on AArch64 and
AArch32: generated code sequences were previously x86-only;
-skip_syscall handling only supported x86; and AArch64 does not
support PTRACE_POKEUSER or PTRACE_PEEKUSER.
For AArch32, Thumb vs Arm mode require multiple steps: clearing LSB to
point at the path used as data via a call; switching to Arm mode for
DR's _start; setting the LSB of the initial app PC.
For AArch32, additionally fixes an encoder error where the opcode is
queried before copying a needs-no-encoding instruction. This is
required for the instruction used to hold data for injection.
Tweaks the disassembler to leave a level 0 instr alone, again to
better handle the data-only insruction used for injection.
Enables the client.attach test on AArch64 and AArch32. For AArch32,
it needs -skip_syscall. Long-term we want that on by default
everywhere but we want explicit tests that hit it on all platforms
first.
Issue: #38