summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/DynamicLoader/Static
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /lldb/source/Plugins/DynamicLoader/Static
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Static')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp19
-rw-r--r--lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h9
2 files changed, 21 insertions, 7 deletions
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) {
diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
index fa9aded7286c8..ce78804f9a923 100644
--- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
+++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_DynamicLoaderStatic_h_
-#define liblldb_DynamicLoaderStatic_h_
+#ifndef LLDB_SOURCE_PLUGINS_DYNAMICLOADER_STATIC_DYNAMICLOADERSTATIC_H
+#define LLDB_SOURCE_PLUGINS_DYNAMICLOADER_STATIC_DYNAMICLOADERSTATIC_H
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/Process.h"
@@ -53,7 +53,8 @@ public:
private:
void LoadAllImagesAtFileAddresses();
- DISALLOW_COPY_AND_ASSIGN(DynamicLoaderStatic);
+ DynamicLoaderStatic(const DynamicLoaderStatic &) = delete;
+ const DynamicLoaderStatic &operator=(const DynamicLoaderStatic &) = delete;
};
-#endif // liblldb_DynamicLoaderStatic_h_
+#endif // LLDB_SOURCE_PLUGINS_DYNAMICLOADER_STATIC_DYNAMICLOADERSTATIC_H