jasonmolenda created this revision.
Herald added subscribers: JDevlieghere, abidh, arphaman, kristof.beyls.
Herald added a project: LLDB.
This patchset adds support for an AArch64 aka arm64 ABI used on Apple's WatchOS
-- it's an ILP32 ABI that runs on the arm64 ISA, e.g. the entire process runs
in the lower 4GB of its address space.
The changes to lldb are minimal; the llvm Triple used is aarch64_32 and 95% of
the patchset is handling that new type as equivalent to aarch64. There are
changes to ArchSpec and PlatformRemoteAppleWatch beyond this aarch64_32 case
addition, and some tests that are skipped, but there's not a whole lot going on
in this patch. From lldb's perspective, these are simply arm64 processes that
seem to be ignoring their top 32bits in their pointers, hah.
There is a unit test to check that arm64_32 is recognized, but most of the
testing of this patch was running the lldb testsuite against an apple watch,
not so much adding new tests specifically for this target.
I wanted to give folks a chance to look this patch over and comment before I
land it.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D69008
Files:
lldb/include/lldb/Utility/ArchSpec.h
lldb/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
lldb/packages/Python/lldbsuite/test/commands/expression/call-function/TestCallStdStringFunction.py
lldb/packages/Python/lldbsuite/test/commands/expression/char/TestExprsChar.py
lldb/packages/Python/lldbsuite/test/commands/expression/persist_objc_pointeetype/TestPersistObjCPointeeType.py
lldb/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
lldb/source/Host/common/NativeProcessProtocol.cpp
lldb/source/Host/macosx/objcxx/Host.mm
lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
lldb/source/Symbol/ClangASTContext.cpp
lldb/source/Symbol/CompactUnwindInfo.cpp
lldb/source/Target/Platform.cpp
lldb/source/Target/Thread.cpp
lldb/source/Utility/ArchSpec.cpp
lldb/tools/compact-unwind/compact-unwind-dumper.c
lldb/tools/debugserver/source/DNB.cpp
lldb/unittests/Utility/ArchSpecTest.cpp
Index: lldb/unittests/Utility/ArchSpecTest.cpp
===
--- lldb/unittests/Utility/ArchSpecTest.cpp
+++ lldb/unittests/Utility/ArchSpecTest.cpp
@@ -157,8 +157,13 @@
ArchSpec A("aarch64");
ArchSpec B("aarch64--linux-android");
+ArchSpec C("arm64_32");
+ArchSpec D("arm64_32--watchos");
+
EXPECT_TRUE(A.IsValid());
EXPECT_TRUE(B.IsValid());
+EXPECT_TRUE(C.IsValid());
+EXPECT_TRUE(D.IsValid());
EXPECT_EQ(llvm::Triple::ArchType::aarch64, B.GetTriple().getArch());
EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
@@ -174,6 +179,17 @@
EXPECT_EQ(llvm::Triple::OSType::Linux, A.GetTriple().getOS());
EXPECT_EQ(llvm::Triple::EnvironmentType::Android,
A.GetTriple().getEnvironment());
+
+EXPECT_EQ(llvm::Triple::ArchType::aarch64_32, D.GetTriple().getArch());
+EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
+ D.GetTriple().getVendor());
+EXPECT_EQ(llvm::Triple::OSType::WatchOS, D.GetTriple().getOS());
+
+C.MergeFrom(D);
+EXPECT_EQ(llvm::Triple::ArchType::aarch64_32, C.GetTriple().getArch());
+EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
+ C.GetTriple().getVendor());
+EXPECT_EQ(llvm::Triple::OSType::WatchOS, C.GetTriple().getOS());
}
{
ArchSpec A, B;
Index: lldb/tools/debugserver/source/DNB.cpp
===
--- lldb/tools/debugserver/source/DNB.cpp
+++