diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-23 19:06:00 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-23 19:06:00 +0000 |
commit | 869ef0a627952545437fab77c3b97854a189625b (patch) | |
tree | efcf3e9f9676b5b80128764122d3a91302a5f69a | |
parent | 72a4621cdf0bb39db58733c63fc98afef6160867 (diff) | |
download | bcm5719-llvm-869ef0a627952545437fab77c3b97854a189625b.tar.gz bcm5719-llvm-869ef0a627952545437fab77c3b97854a189625b.zip |
[ABISysV] Fix regression for Simulator and MacABI
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 on Github that exercises this code path and which I'd
like to upstream once the remaining MacABI parts become available in
clang.
Differential revision: https://reviews.llvm.org/D67869
llvm-svn: 372642
-rw-r--r-- | lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp index 80b99e6b42b..7370e110722 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -222,17 +222,33 @@ ABISP 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::FreeBSD: - case llvm::Triple::OSType::NetBSD: - case llvm::Triple::OSType::Solaris: - case llvm::Triple::OSType::UnknownOS: + case llvm::Triple::OSType::IOS: + case llvm::Triple::OSType::TvOS: + case llvm::Triple::OSType::WatchOS: + switch (os_env) { + case llvm::Triple::EnvironmentType::MacABI: + case llvm::Triple::EnvironmentType::Simulator: + case llvm::Triple::EnvironmentType::UnknownEnvironment: + // UnknownEnvironment is needed for older compilers that don't + // support the simulator environment. return ABISP(new ABISysV_x86_64(process_sp)); - default: + default: return ABISP(); + } + case llvm::Triple::OSType::Darwin: + 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: + return ABISP(); } } return ABISP(); |