This is an archive of the discontinued LLVM Phabricator instance.

Fix NativeProcessLinux Read/Write register operations for arm
AbandonedPublic

Authored by omjavaid on Apr 20 2015, 3:47 AM.

Details

Summary

ptrace on arm doesnt support PTRACE_PEEKUSER/PTRACE_POKEUSER operations for register read/write.

To work around this we use PTRACE_GETREGS/PTRACE_SETREGS ptrace operations.

This patch fixes ReadRegOperation and WriteRegOperation in NativeProcessLinux to make sure we use correct method for register access on arm.

Diff Detail

Event Timeline

omjavaid updated this revision to Diff 24006.Apr 20 2015, 3:47 AM
omjavaid retitled this revision from to Fix NativeProcessLinux Read/Write register operations for arm.
omjavaid updated this object.
omjavaid edited the test plan for this revision. (Show Details)
omjavaid added reviewers: tberghammer, vharron, emaste.
omjavaid added a subscriber: Unknown Object (MLST).
tberghammer requested changes to this revision.Apr 20 2015, 6:49 AM
tberghammer edited edge metadata.

The general concept looks good but the following types are not defined on android:

elf_greg_t
elf_gregset_t
elf_fpregset_t

Please add their definition to source/Plugins/Process/Linux/Procfs.h where we already define them for arm64.

Exactly what type of error you seen without this patch? On android I haven't seen any problem reading out the registers without this patch either but it works also after applying this change (and hacking around the compile issue).

This revision now requires changes to proceed.Apr 20 2015, 6:49 AM
labath resigned from this revision.May 11 2015, 3:11 AM
labath removed a reviewer: labath.

Do you see any failure caused by the lack of this patch? On android-arm, register read works without any change, so I am not sure what is the original background of this change, and I prefer not to apply it for android as PTRACE_GETREGS is slower then PTRACE_POKEUSER.

omjavaid abandoned this revision.Feb 9 2016, 12:10 AM