From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- .../DynamicLoader/Static/DynamicLoaderStatic.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp') diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp index 6bc951c4d35b2..48762fe6e0c30 100644 --- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp +++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp @@ -1,4 +1,4 @@ -//===-- DynamicLoaderStatic.cpp ---------------------------------*- C++ -*-===// +//===-- DynamicLoaderStatic.cpp -------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -17,6 +17,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN_DEFINE(DynamicLoaderStatic) + // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. @@ -27,8 +29,19 @@ DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process, const llvm::Triple &triple_ref = process->GetTarget().GetArchitecture().GetTriple(); const llvm::Triple::OSType os_type = triple_ref.getOS(); - if ((os_type == llvm::Triple::UnknownOS)) - create = true; + const llvm::Triple::ArchType arch_type = triple_ref.getArch(); + if (os_type == llvm::Triple::UnknownOS) { + // The WASM and Hexagon plugin check the ArchType rather than the OSType, + // so explicitly reject those here. + switch(arch_type) { + case llvm::Triple::hexagon: + case llvm::Triple::wasm32: + case llvm::Triple::wasm64: + break; + default: + create = true; + } + } } if (!create) { -- cgit v1.2.3