[Lldb-commits] [PATCH] D67869: [ABISysV] Fix regression for Simulator and MacABI

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 20 16:41:22 PDT 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: aprantl, xiaobai.
Herald added a subscriber: abidh.
Herald added a project: LLDB.

The ABISysV ABI was refactored in r364216 to support the Windows ABI for x86_64. In particular it changed `ABISysV_x86_64::CreateInstance` to switch on the OS type. This breaks debugging MacABI apps as well as apps in the simulator. This adds back the necessary cases.

We have a test internally that exercises this code path but some MacABI parts are still missing upstream.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D67869

Files:
  lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp


Index: lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
===================================================================
--- lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
+++ lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
@@ -222,16 +222,28 @@
 ABISysV_x86_64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
   const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
   const llvm::Triple::OSType os_type = arch.GetTriple().getOS();
+  const llvm::Triple::EnvironmentType os_env = arch.GetTriple().getEnvironment();
   if (arch_type == llvm::Triple::x86_64) {
     switch(os_type) {
-      case llvm::Triple::OSType::MacOSX:
-      case llvm::Triple::OSType::Linux:
+      case llvm::Triple::OSType::IOS:
+      case llvm::Triple::OSType::TvOS:
+      case llvm::Triple::OSType::WatchOS:
+        switch(os_env) {
+          case llvm::Triple::EnvironmentType::Simulator:
+          case llvm::Triple::EnvironmentType::UnknownEnvironment:
+          case llvm::Triple::EnvironmentType::MacABI:
+            return ABISP(new ABISysV_x86_64(process_sp));
+          default:
+            return ABISP();
+        }
       case llvm::Triple::OSType::FreeBSD:
+      case llvm::Triple::OSType::Linux:
+      case llvm::Triple::OSType::MacOSX:
       case llvm::Triple::OSType::NetBSD:
       case llvm::Triple::OSType::Solaris:
       case llvm::Triple::OSType::UnknownOS:
         return ABISP(new ABISysV_x86_64(process_sp));
-      default: 
+      default:
         return ABISP();
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67869.221134.patch
Type: text/x-patch
Size: 1553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190920/d0d2bdc8/attachment.bin>


More information about the lldb-commits mailing list