This is an archive of the discontinued LLVM Phabricator instance.

Work around a stepping bug in arm64 android M
ClosedPublic

Authored by labath on Feb 22 2016, 8:23 AM.

Details

Summary

On arm64, linux<=4.4 and Android<=M there is a bug, which prevents single-stepping from working when
the system comes back from suspend, because of incorrectly initialized CPUs. This did not really
affect Android<M, because it did not use software suspend, but it is a problem for M, which uses
suspend (doze) quite extensively. Fortunately, it seems that the first CPU is not affected by
this bug, so this commit implements a workaround by forcing the inferior to execute on the first
cpu whenever we are doing single stepping.

While inside, I have moved the implementations of Resume() and SingleStep() to the thread class
(instead of process).

Diff Detail

Event Timeline

labath updated this revision to Diff 48689.Feb 22 2016, 8:23 AM
labath retitled this revision from to Work around a stepping bug in arm64 android M.
labath updated this object.
labath added reviewers: tberghammer, ovyalov.
labath added a subscriber: lldb-commits.
labath updated this revision to Diff 48690.Feb 22 2016, 8:29 AM

Avoid an unused function warning on non-arm64 arches.

ovyalov accepted this revision.Feb 22 2016, 10:45 AM
ovyalov edited edge metadata.
ovyalov added inline comments.
source/Plugins/Process/Linux/NativeThreadLinux.cpp
250

Could you use Error error(errno, eErrorTypePOSIX) instead of strerror here?

source/Plugins/Process/Linux/SingleStepCheck.cpp
80

Kill child before return?

source/Plugins/Process/Linux/SingleStepCheck.h
42

s/liblldb_NativeThreadLinux_H_/liblldb_SingleStepCheck_H_

This revision is now accepted and ready to land.Feb 22 2016, 10:45 AM
This revision was automatically updated to reflect the committed changes.
labath marked 2 inline comments as done.