This is an archive of the discontinued LLVM Phabricator instance.

Create NativeRegisterContext for android-arm64
ClosedPublic

Authored by tberghammer on Mar 4 2015, 6:45 AM.

Details

Summary

Create NativeRegisterContext for android-arm64

This patch contains all of the major changes required to get lldb-server running on android-arm64 with some very basic functionalists.

Most of the code for the NativeRegisterContextLinux_arm64 class is copied over form the RegisterContextPOSIX_arm64 class (same approach as the one used for NativeRegisterContext_x86_64). The common code between NativeRegisterContextLinux_arm64 and NativeRegisterContextLinux_x86_64 will be factored out to a common base class with a later commit.

Diff Detail

Event Timeline

tberghammer updated this revision to Diff 21196.Mar 4 2015, 6:45 AM
tberghammer retitled this revision from to Create NativeRegisterContext for android-arm64.
tberghammer updated this object.
tberghammer edited the test plan for this revision. (Show Details)
tberghammer added reviewers: chaoren, vharron, ovyalov.
tberghammer added a subscriber: Unknown Object (MLST).
vharron edited edge metadata.Mar 4 2015, 9:00 AM

Adding Ed as reviewer

source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
109

Just curious, why not static const int?

source/Plugins/Process/Linux/ProcessMonitor.cpp
51

duplicate block of defines should be moved into common header?

vharron removed a subscriber: emaste.
chaoren edited edge metadata.Mar 4 2015, 11:56 AM

It would be nice if you showed the diff of the new files from the originals. I.e., git diff -U999999 -C -C

It would be nice if you showed the diff of the new files from the originals. I.e., git diff -U999999 -C -C

The similarity index for the files are so low (22% maximum) it wouldn't make any sense. This is caused by the very different code structure used by the RegisterContext* classes and the NativeRegisterContext* classes.

P.S.: I noticed that some part of the code is based on the RegisterContextPOSIXProcessMonitor_arm64 class.

source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
109

It came from RegisterContextPOSIX_armm64, and I haven't changed it.

source/Plugins/Process/Linux/ProcessMonitor.cpp
51

Will fix it tomorrow.
Do you have any suggestion for the name and location of the file (AndroidProcfs_arm64)?

vharron added inline comments.Mar 4 2015, 6:51 PM
source/Plugins/Process/Linux/ProcessMonitor.cpp
51

source/Plugins/Process/Linux/Procfs.h

Comment in the header:

source/Plugins/Process/Linux/Procfs.h defines the symbols we need from Procfs.h on Android/Linux for all supported architectures.

nit: I would always to positive case first

e.g.

#ifdef ANDROID

is easier to read than

#ifndef ANDROID

tberghammer updated this revision to Diff 21338.Mar 6 2015, 2:57 AM
tberghammer edited edge metadata.

Move Procfs related code to separate file

tberghammer updated this revision to Diff 21341.Mar 6 2015, 3:56 AM

Add missing include

Friendly ping.

vharron accepted this revision.Mar 12 2015, 9:08 AM
vharron edited edge metadata.
This revision is now accepted and ready to land.Mar 12 2015, 9:08 AM
This revision was automatically updated to reflect the committed changes.