Coverage Report

Created: 2022-01-22 13:19

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Core/PluginManager.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- PluginManager.cpp -------------------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "lldb/Core/PluginManager.h"
10
11
#include "lldb/Core/Debugger.h"
12
#include "lldb/Host/FileSystem.h"
13
#include "lldb/Host/HostInfo.h"
14
#include "lldb/Interpreter/OptionValueProperties.h"
15
#include "lldb/Target/Process.h"
16
#include "lldb/Utility/ConstString.h"
17
#include "lldb/Utility/FileSpec.h"
18
#include "lldb/Utility/Status.h"
19
#include "lldb/Utility/StringList.h"
20
#include "llvm/ADT/StringRef.h"
21
#include "llvm/Support/DynamicLibrary.h"
22
#include "llvm/Support/FileSystem.h"
23
#include "llvm/Support/raw_ostream.h"
24
#include <cassert>
25
#include <map>
26
#include <memory>
27
#include <mutex>
28
#include <string>
29
#include <utility>
30
#include <vector>
31
#if defined(_WIN32)
32
#include "lldb/Host/windows/PosixApi.h"
33
#endif
34
35
using namespace lldb;
36
using namespace lldb_private;
37
38
typedef bool (*PluginInitCallback)();
39
typedef void (*PluginTermCallback)();
40
41
struct PluginInfo {
42
0
  PluginInfo() = default;
43
44
  llvm::sys::DynamicLibrary library;
45
  PluginInitCallback plugin_init_callback = nullptr;
46
  PluginTermCallback plugin_term_callback = nullptr;
47
};
48
49
typedef std::map<FileSpec, PluginInfo> PluginTerminateMap;
50
51
3.43k
static std::recursive_mutex &GetPluginMapMutex() {
52
3.43k
  static std::recursive_mutex g_plugin_map_mutex;
53
3.43k
  return g_plugin_map_mutex;
54
3.43k
}
55
56
3.43k
static PluginTerminateMap &GetPluginMap() {
57
3.43k
  static PluginTerminateMap g_plugin_map;
58
3.43k
  return g_plugin_map;
59
3.43k
}
60
61
0
static bool PluginIsLoaded(const FileSpec &plugin_file_spec) {
62
0
  std::lock_guard<std::recursive_mutex> guard(GetPluginMapMutex());
63
0
  PluginTerminateMap &plugin_map = GetPluginMap();
64
0
  return plugin_map.find(plugin_file_spec) != plugin_map.end();
65
0
}
66
67
static void SetPluginInfo(const FileSpec &plugin_file_spec,
68
0
                          const PluginInfo &plugin_info) {
69
0
  std::lock_guard<std::recursive_mutex> guard(GetPluginMapMutex());
70
0
  PluginTerminateMap &plugin_map = GetPluginMap();
71
0
  assert(plugin_map.find(plugin_file_spec) == plugin_map.end());
72
0
  plugin_map[plugin_file_spec] = plugin_info;
73
0
}
74
75
0
template <typename FPtrTy> static FPtrTy CastToFPtr(void *VPtr) {
76
0
  return reinterpret_cast<FPtrTy>(VPtr);
77
0
}
Unexecuted instantiation: PluginManager.cpp:bool (*CastToFPtr<bool (*)()>(void*))()
Unexecuted instantiation: PluginManager.cpp:void (*CastToFPtr<void (*)()>(void*))()
78
79
static FileSystem::EnumerateDirectoryResult
80
LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
81
0
                   llvm::StringRef path) {
82
0
  Status error;
83
84
0
  namespace fs = llvm::sys::fs;
85
  // If we have a regular file, a symbolic link or unknown file type, try and
86
  // process the file. We must handle unknown as sometimes the directory
87
  // enumeration might be enumerating a file system that doesn't have correct
88
  // file type information.
89
0
  if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
90
0
      ft == fs::file_type::type_unknown) {
91
0
    FileSpec plugin_file_spec(path);
92
0
    FileSystem::Instance().Resolve(plugin_file_spec);
93
94
0
    if (PluginIsLoaded(plugin_file_spec))
95
0
      return FileSystem::eEnumerateDirectoryResultNext;
96
0
    else {
97
0
      PluginInfo plugin_info;
98
99
0
      std::string pluginLoadError;
100
0
      plugin_info.library = llvm::sys::DynamicLibrary::getPermanentLibrary(
101
0
          plugin_file_spec.GetPath().c_str(), &pluginLoadError);
102
0
      if (plugin_info.library.isValid()) {
103
0
        bool success = false;
104
0
        plugin_info.plugin_init_callback = CastToFPtr<PluginInitCallback>(
105
0
            plugin_info.library.getAddressOfSymbol("LLDBPluginInitialize"));
106
0
        if (plugin_info.plugin_init_callback) {
107
          // Call the plug-in "bool LLDBPluginInitialize(void)" function
108
0
          success = plugin_info.plugin_init_callback();
109
0
        }
110
111
0
        if (success) {
112
          // It is ok for the "LLDBPluginTerminate" symbol to be nullptr
113
0
          plugin_info.plugin_term_callback = CastToFPtr<PluginTermCallback>(
114
0
              plugin_info.library.getAddressOfSymbol("LLDBPluginTerminate"));
115
0
        } else {
116
          // The initialize function returned FALSE which means the plug-in
117
          // might not be compatible, or might be too new or too old, or might
118
          // not want to run on this machine.  Set it to a default-constructed
119
          // instance to invalidate it.
120
0
          plugin_info = PluginInfo();
121
0
        }
122
123
        // Regardless of success or failure, cache the plug-in load in our
124
        // plug-in info so we don't try to load it again and again.
125
0
        SetPluginInfo(plugin_file_spec, plugin_info);
126
127
0
        return FileSystem::eEnumerateDirectoryResultNext;
128
0
      }
129
0
    }
130
0
  }
131
132
0
  if (ft == fs::file_type::directory_file ||
133
0
      ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
134
    // Try and recurse into anything that a directory or symbolic link. We must
135
    // also do this for unknown as sometimes the directory enumeration might be
136
    // enumerating a file system that doesn't have correct file type
137
    // information.
138
0
    return FileSystem::eEnumerateDirectoryResultEnter;
139
0
  }
140
141
0
  return FileSystem::eEnumerateDirectoryResultNext;
142
0
}
143
144
3.44k
void PluginManager::Initialize() {
145
3.44k
  const bool find_directories = true;
146
3.44k
  const bool find_files = true;
147
3.44k
  const bool find_other = true;
148
3.44k
  char dir_path[PATH_MAX];
149
3.44k
  if (FileSpec dir_spec = HostInfo::GetSystemPluginDir()) {
150
0
    if (FileSystem::Instance().Exists(dir_spec) &&
151
0
        dir_spec.GetPath(dir_path, sizeof(dir_path))) {
152
0
      FileSystem::Instance().EnumerateDirectory(dir_path, find_directories,
153
0
                                                find_files, find_other,
154
0
                                                LoadPluginCallback, nullptr);
155
0
    }
156
0
  }
157
158
3.44k
  if (FileSpec dir_spec = HostInfo::GetUserPluginDir()) {
159
3.44k
    if (FileSystem::Instance().Exists(dir_spec) &&
160
3.44k
        
dir_spec.GetPath(dir_path, sizeof(dir_path))0
) {
161
0
      FileSystem::Instance().EnumerateDirectory(dir_path, find_directories,
162
0
                                                find_files, find_other,
163
0
                                                LoadPluginCallback, nullptr);
164
0
    }
165
3.44k
  }
166
3.44k
}
167
168
3.43k
void PluginManager::Terminate() {
169
3.43k
  std::lock_guard<std::recursive_mutex> guard(GetPluginMapMutex());
170
3.43k
  PluginTerminateMap &plugin_map = GetPluginMap();
171
172
3.43k
  PluginTerminateMap::const_iterator pos, end = plugin_map.end();
173
3.43k
  for (pos = plugin_map.begin(); pos != end; 
++pos0
) {
174
    // Call the plug-in "void LLDBPluginTerminate (void)" function if there is
175
    // one (if the symbol was not nullptr).
176
0
    if (pos->second.library.isValid()) {
177
0
      if (pos->second.plugin_term_callback)
178
0
        pos->second.plugin_term_callback();
179
0
    }
180
0
  }
181
3.43k
  plugin_map.clear();
182
3.43k
}
183
184
template <typename Callback> struct PluginInstance {
185
  typedef Callback CallbackType;
186
187
  PluginInstance() = default;
188
  PluginInstance(llvm::StringRef name, llvm::StringRef description,
189
                 Callback create_callback,
190
                 DebuggerInitializeCallback debugger_init_callback = nullptr)
191
      : name(name), description(description), create_callback(create_callback),
192
316k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::ABI> (*)(std::__1::shared_ptr<lldb_private::Process>, lldb_private::ArchSpec const&)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::ABI> (*)(std::__1::shared_ptr<lldb_private::Process>, lldb_private::ArchSpec const&), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
27.5k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::unique_ptr<lldb_private::Architecture, std::__1::default_delete<lldb_private::Architecture> > (*)(lldb_private::ArchSpec const&)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::unique_ptr<lldb_private::Architecture, std::__1::default_delete<lldb_private::Architecture> > (*)(lldb_private::ArchSpec const&), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
13.7k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.44k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
27.5k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.44k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
17.2k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.44k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::Language* (*)(lldb::LanguageType)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::Language* (*)(lldb::LanguageType), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
10.4k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::LanguageRuntime* (*)(lldb_private::Process*, lldb::LanguageType)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::LanguageRuntime* (*)(lldb_private::Process*, lldb::LanguageType), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
13.7k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::SystemRuntime* (*)(lldb_private::Process*)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::SystemRuntime* (*)(lldb_private::Process*), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.44k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::ObjectFile* (*)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::ObjectFile* (*)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
27.5k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::ObjectContainer* (*)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::ObjectContainer* (*)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
6.88k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
61.9k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
23.9k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::ScriptInterpreter> (*)(lldb_private::Debugger&)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::ScriptInterpreter> (*)(lldb_private::Debugger&), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
6.79k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::StructuredDataPlugin> (*)(lldb_private::Process&)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::StructuredDataPlugin> (*)(lldb_private::Process&), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.44k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
17.2k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::SymbolVendor* (*)(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::SymbolVendor* (*)(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
10.3k
        debugger_init_callback(debugger_init_callback) {}
Unexecuted instantiation: PluginInstance<llvm::Expected<std::__1::shared_ptr<lldb_private::Trace> > (*)(llvm::json::Value const&, llvm::StringRef, lldb_private::Debugger&)>::PluginInstance(llvm::StringRef, llvm::StringRef, llvm::Expected<std::__1::shared_ptr<lldb_private::Trace> > (*)(llvm::json::Value const&, llvm::StringRef, lldb_private::Debugger&), void (*)(lldb_private::Debugger&))
PluginInstance<llvm::Expected<std::__1::unique_ptr<lldb_private::TraceExporter, std::__1::default_delete<lldb_private::TraceExporter> > > (*)()>::PluginInstance(llvm::StringRef, llvm::StringRef, llvm::Expected<std::__1::unique_ptr<lldb_private::TraceExporter, std::__1::default_delete<lldb_private::TraceExporter> > > (*)(), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.44k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<lldb_private::UnwindAssembly* (*)(lldb_private::ArchSpec const&)>::PluginInstance(llvm::StringRef, llvm::StringRef, lldb_private::UnwindAssembly* (*)(lldb_private::ArchSpec const&), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
6.88k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::MemoryHistory> (*)(std::__1::shared_ptr<lldb_private::Process> const&)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::MemoryHistory> (*)(std::__1::shared_ptr<lldb_private::Process> const&), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.44k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::InstrumentationRuntime> (*)(std::__1::shared_ptr<lldb_private::Process> const&)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::InstrumentationRuntime> (*)(std::__1::shared_ptr<lldb_private::Process> const&), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
13.7k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::TypeSystem> (*)(lldb::LanguageType, lldb_private::Module*, lldb_private::Target*)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::TypeSystem> (*)(lldb::LanguageType, lldb_private::Module*, lldb_private::Target*), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.47k
        debugger_init_callback(debugger_init_callback) {}
PluginInstance<std::__1::shared_ptr<lldb_private::REPL> (*)(lldb_private::Status&, lldb::LanguageType, lldb_private::Debugger*, lldb_private::Target*, char const*)>::PluginInstance(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::REPL> (*)(lldb_private::Status&, lldb::LanguageType, lldb_private::Debugger*, lldb_private::Target*, char const*), void (*)(lldb_private::Debugger&))
Line
Count
Source
192
3.44k
        debugger_init_callback(debugger_init_callback) {}
193
194
  llvm::StringRef name;
195
  llvm::StringRef description;
196
  Callback create_callback;
197
  DebuggerInitializeCallback debugger_init_callback;
198
};
199
200
template <typename Instance> class PluginInstances {
201
public:
202
  template <typename... Args>
203
  bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
204
                      typename Instance::CallbackType callback,
205
302k
                      Args &&...args) {
206
302k
    if (!callback)
207
0
      return false;
208
302k
    assert(!name.empty());
209
0
    Instance instance =
210
302k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
302k
    m_instances.push_back(instance);
212
302k
    return false;
213
302k
  }
bool PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::ABI> (*)(std::__1::shared_ptr<lldb_private::Process>, lldb_private::ArchSpec const&)> >::RegisterPlugin<>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::ABI> (*)(std::__1::shared_ptr<lldb_private::Process>, lldb_private::ArchSpec const&))
Line
Count
Source
205
27.5k
                      Args &&...args) {
206
27.5k
    if (!callback)
207
0
      return false;
208
27.5k
    assert(!name.empty());
209
0
    Instance instance =
210
27.5k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
27.5k
    m_instances.push_back(instance);
212
27.5k
    return false;
213
27.5k
  }
bool PluginInstances<PluginInstance<lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*)> >::RegisterPlugin<>(llvm::StringRef, llvm::StringRef, lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*))
Line
Count
Source
205
3.44k
                      Args &&...args) {
206
3.44k
    if (!callback)
207
0
      return false;
208
3.44k
    assert(!name.empty());
209
0
    Instance instance =
210
3.44k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.44k
    m_instances.push_back(instance);
212
3.44k
    return false;
213
3.44k
  }
bool PluginInstances<PluginInstance<lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool)> >::RegisterPlugin<void (*&)(lldb_private::Debugger&)>(llvm::StringRef, llvm::StringRef, lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool), void (*&)(lldb_private::Debugger&))
Line
Count
Source
205
27.5k
                      Args &&...args) {
206
27.5k
    if (!callback)
207
0
      return false;
208
27.5k
    assert(!name.empty());
209
0
    Instance instance =
210
27.5k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
27.5k
    m_instances.push_back(instance);
212
27.5k
    return false;
213
27.5k
  }
bool PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool)> >::RegisterPlugin<void (*&)(lldb_private::Debugger&)>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool), void (*&)(lldb_private::Debugger&))
Line
Count
Source
205
3.44k
                      Args &&...args) {
206
3.44k
    if (!callback)
207
0
      return false;
208
3.44k
    assert(!name.empty());
209
0
    Instance instance =
210
3.44k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.44k
    m_instances.push_back(instance);
212
3.44k
    return false;
213
3.44k
  }
bool PluginInstances<PluginInstance<lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType)> >::RegisterPlugin<>(llvm::StringRef, llvm::StringRef, lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType))
Line
Count
Source
205
17.2k
                      Args &&...args) {
206
17.2k
    if (!callback)
207
0
      return false;
208
17.2k
    assert(!name.empty());
209
0
    Instance instance =
210
17.2k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
17.2k
    m_instances.push_back(instance);
212
17.2k
    return false;
213
17.2k
  }
bool PluginInstances<PluginInstance<lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool)> >::RegisterPlugin<void (*&)(lldb_private::Debugger&)>(llvm::StringRef, llvm::StringRef, lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool), void (*&)(lldb_private::Debugger&))
Line
Count
Source
205
3.44k
                      Args &&...args) {
206
3.44k
    if (!callback)
207
0
      return false;
208
3.44k
    assert(!name.empty());
209
0
    Instance instance =
210
3.44k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.44k
    m_instances.push_back(instance);
212
3.44k
    return false;
213
3.44k
  }
bool PluginInstances<PluginInstance<lldb_private::Language* (*)(lldb::LanguageType)> >::RegisterPlugin<>(llvm::StringRef, llvm::StringRef, lldb_private::Language* (*)(lldb::LanguageType))
Line
Count
Source
205
10.4k
                      Args &&...args) {
206
10.4k
    if (!callback)
207
0
      return false;
208
10.4k
    assert(!name.empty());
209
0
    Instance instance =
210
10.4k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
10.4k
    m_instances.push_back(instance);
212
10.4k
    return false;
213
10.4k
  }
bool PluginInstances<LanguageRuntimeInstance>::RegisterPlugin<std::nullptr_t, std::__1::shared_ptr<lldb_private::CommandObject> (*&)(lldb_private::CommandInterpreter&), std::__1::shared_ptr<lldb_private::BreakpointPrecondition> (*&)(lldb::LanguageType, bool)>(llvm::StringRef, llvm::StringRef, lldb_private::LanguageRuntime* (*)(lldb_private::Process*, lldb::LanguageType), std::nullptr_t&&, std::__1::shared_ptr<lldb_private::CommandObject> (*&)(lldb_private::CommandInterpreter&), std::__1::shared_ptr<lldb_private::BreakpointPrecondition> (*&)(lldb::LanguageType, bool))
Line
Count
Source
205
13.7k
                      Args &&...args) {
206
13.7k
    if (!callback)
207
0
      return false;
208
13.7k
    assert(!name.empty());
209
0
    Instance instance =
210
13.7k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
13.7k
    m_instances.push_back(instance);
212
13.7k
    return false;
213
13.7k
  }
bool PluginInstances<PluginInstance<lldb_private::SystemRuntime* (*)(lldb_private::Process*)> >::RegisterPlugin<>(llvm::StringRef, llvm::StringRef, lldb_private::SystemRuntime* (*)(lldb_private::Process*))
Line
Count
Source
205
3.44k
                      Args &&...args) {
206
3.44k
    if (!callback)
207
0
      return false;
208
3.44k
    assert(!name.empty());
209
0
    Instance instance =
210
3.44k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.44k
    m_instances.push_back(instance);
212
3.44k
    return false;
213
3.44k
  }
bool PluginInstances<ObjectFileInstance>::RegisterPlugin<lldb_private::ObjectFile* (*&)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, std::__1::shared_ptr<lldb_private::Process> const&, unsigned long long), unsigned long (*&)(lldb_private::FileSpec const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, unsigned long long, unsigned long long, lldb_private::ModuleSpecList&), bool (*&)(std::__1::shared_ptr<lldb_private::Process> const&, lldb_private::FileSpec const&, lldb::SaveCoreStyle&, lldb_private::Status&)>(llvm::StringRef, llvm::StringRef, lldb_private::ObjectFile* (*)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long), lldb_private::ObjectFile* (*&)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, std::__1::shared_ptr<lldb_private::Process> const&, unsigned long long), unsigned long (*&)(lldb_private::FileSpec const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, unsigned long long, unsigned long long, lldb_private::ModuleSpecList&), bool (*&)(std::__1::shared_ptr<lldb_private::Process> const&, lldb_private::FileSpec const&, lldb::SaveCoreStyle&, lldb_private::Status&))
Line
Count
Source
205
27.5k
                      Args &&...args) {
206
27.5k
    if (!callback)
207
0
      return false;
208
27.5k
    assert(!name.empty());
209
0
    Instance instance =
210
27.5k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
27.5k
    m_instances.push_back(instance);
212
27.5k
    return false;
213
27.5k
  }
bool PluginInstances<ObjectContainerInstance>::RegisterPlugin<unsigned long (*&)(lldb_private::FileSpec const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, unsigned long long, unsigned long long, lldb_private::ModuleSpecList&)>(llvm::StringRef, llvm::StringRef, lldb_private::ObjectContainer* (*)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long), unsigned long (*&)(lldb_private::FileSpec const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, unsigned long long, unsigned long long, lldb_private::ModuleSpecList&))
Line
Count
Source
205
6.88k
                      Args &&...args) {
206
6.88k
    if (!callback)
207
0
      return false;
208
6.88k
    assert(!name.empty());
209
0
    Instance instance =
210
6.88k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
6.88k
    m_instances.push_back(instance);
212
6.88k
    return false;
213
6.88k
  }
bool PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::RegisterPlugin<void (*&)(lldb_private::Debugger&)>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*), void (*&)(lldb_private::Debugger&))
Line
Count
Source
205
61.9k
                      Args &&...args) {
206
61.9k
    if (!callback)
207
0
      return false;
208
61.9k
    assert(!name.empty());
209
0
    Instance instance =
210
61.9k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
61.9k
    m_instances.push_back(instance);
212
61.9k
    return false;
213
61.9k
  }
bool PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::RegisterPlugin<void (*&)(lldb_private::Debugger&)>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool), void (*&)(lldb_private::Debugger&))
Line
Count
Source
205
23.9k
                      Args &&...args) {
206
23.9k
    if (!callback)
207
0
      return false;
208
23.9k
    assert(!name.empty());
209
0
    Instance instance =
210
23.9k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
23.9k
    m_instances.push_back(instance);
212
23.9k
    return false;
213
23.9k
  }
bool PluginInstances<ScriptInterpreterInstance>::RegisterPlugin<lldb::ScriptLanguage&>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::ScriptInterpreter> (*)(lldb_private::Debugger&), lldb::ScriptLanguage&)
Line
Count
Source
205
6.79k
                      Args &&...args) {
206
6.79k
    if (!callback)
207
0
      return false;
208
6.79k
    assert(!name.empty());
209
0
    Instance instance =
210
6.79k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
6.79k
    m_instances.push_back(instance);
212
6.79k
    return false;
213
6.79k
  }
bool PluginInstances<StructuredDataPluginInstance>::RegisterPlugin<void (*&)(lldb_private::Debugger&), lldb_private::Status (*&)(lldb_private::ProcessLaunchInfo&, lldb_private::Target*)>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::StructuredDataPlugin> (*)(lldb_private::Process&), void (*&)(lldb_private::Debugger&), lldb_private::Status (*&)(lldb_private::ProcessLaunchInfo&, lldb_private::Target*))
Line
Count
Source
205
3.44k
                      Args &&...args) {
206
3.44k
    if (!callback)
207
0
      return false;
208
3.44k
    assert(!name.empty());
209
0
    Instance instance =
210
3.44k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.44k
    m_instances.push_back(instance);
212
3.44k
    return false;
213
3.44k
  }
bool PluginInstances<PluginInstance<lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>)> >::RegisterPlugin<void (*&)(lldb_private::Debugger&)>(llvm::StringRef, llvm::StringRef, lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>), void (*&)(lldb_private::Debugger&))
Line
Count
Source
205
17.2k
                      Args &&...args) {
206
17.2k
    if (!callback)
207
0
      return false;
208
17.2k
    assert(!name.empty());
209
0
    Instance instance =
210
17.2k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
17.2k
    m_instances.push_back(instance);
212
17.2k
    return false;
213
17.2k
  }
bool PluginInstances<PluginInstance<lldb_private::SymbolVendor* (*)(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*)> >::RegisterPlugin<>(llvm::StringRef, llvm::StringRef, lldb_private::SymbolVendor* (*)(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*))
Line
Count
Source
205
10.3k
                      Args &&...args) {
206
10.3k
    if (!callback)
207
0
      return false;
208
10.3k
    assert(!name.empty());
209
0
    Instance instance =
210
10.3k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
10.3k
    m_instances.push_back(instance);
212
10.3k
    return false;
213
10.3k
  }
Unexecuted instantiation: bool PluginInstances<TraceInstance>::RegisterPlugin<llvm::Expected<std::__1::shared_ptr<lldb_private::Trace> > (*&)(lldb_private::Process&), llvm::StringRef&>(llvm::StringRef, llvm::StringRef, llvm::Expected<std::__1::shared_ptr<lldb_private::Trace> > (*)(llvm::json::Value const&, llvm::StringRef, lldb_private::Debugger&), llvm::Expected<std::__1::shared_ptr<lldb_private::Trace> > (*&)(lldb_private::Process&), llvm::StringRef&)
bool PluginInstances<TraceExporterInstance>::RegisterPlugin<std::__1::shared_ptr<lldb_private::CommandObject> (*&)(lldb_private::CommandInterpreter&)>(llvm::StringRef, llvm::StringRef, llvm::Expected<std::__1::unique_ptr<lldb_private::TraceExporter, std::__1::default_delete<lldb_private::TraceExporter> > > (*)(), std::__1::shared_ptr<lldb_private::CommandObject> (*&)(lldb_private::CommandInterpreter&))
Line
Count
Source
205
3.44k
                      Args &&...args) {
206
3.44k
    if (!callback)
207
0
      return false;
208
3.44k
    assert(!name.empty());
209
0
    Instance instance =
210
3.44k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.44k
    m_instances.push_back(instance);
212
3.44k
    return false;
213
3.44k
  }
bool PluginInstances<PluginInstance<lldb_private::UnwindAssembly* (*)(lldb_private::ArchSpec const&)> >::RegisterPlugin<>(llvm::StringRef, llvm::StringRef, lldb_private::UnwindAssembly* (*)(lldb_private::ArchSpec const&))
Line
Count
Source
205
6.88k
                      Args &&...args) {
206
6.88k
    if (!callback)
207
0
      return false;
208
6.88k
    assert(!name.empty());
209
0
    Instance instance =
210
6.88k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
6.88k
    m_instances.push_back(instance);
212
6.88k
    return false;
213
6.88k
  }
bool PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::MemoryHistory> (*)(std::__1::shared_ptr<lldb_private::Process> const&)> >::RegisterPlugin<>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::MemoryHistory> (*)(std::__1::shared_ptr<lldb_private::Process> const&))
Line
Count
Source
205
3.44k
                      Args &&...args) {
206
3.44k
    if (!callback)
207
0
      return false;
208
3.44k
    assert(!name.empty());
209
0
    Instance instance =
210
3.44k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.44k
    m_instances.push_back(instance);
212
3.44k
    return false;
213
3.44k
  }
bool PluginInstances<InstrumentationRuntimeInstance>::RegisterPlugin<lldb::InstrumentationRuntimeType (*&)()>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::InstrumentationRuntime> (*)(std::__1::shared_ptr<lldb_private::Process> const&), lldb::InstrumentationRuntimeType (*&)())
Line
Count
Source
205
13.7k
                      Args &&...args) {
206
13.7k
    if (!callback)
207
0
      return false;
208
13.7k
    assert(!name.empty());
209
0
    Instance instance =
210
13.7k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
13.7k
    m_instances.push_back(instance);
212
13.7k
    return false;
213
13.7k
  }
bool PluginInstances<TypeSystemInstance>::RegisterPlugin<lldb_private::LanguageSet&, lldb_private::LanguageSet&>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::TypeSystem> (*)(lldb::LanguageType, lldb_private::Module*, lldb_private::Target*), lldb_private::LanguageSet&, lldb_private::LanguageSet&)
Line
Count
Source
205
3.47k
                      Args &&...args) {
206
3.47k
    if (!callback)
207
0
      return false;
208
3.47k
    assert(!name.empty());
209
0
    Instance instance =
210
3.47k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.47k
    m_instances.push_back(instance);
212
3.47k
    return false;
213
3.47k
  }
bool PluginInstances<REPLInstance>::RegisterPlugin<lldb_private::LanguageSet&>(llvm::StringRef, llvm::StringRef, std::__1::shared_ptr<lldb_private::REPL> (*)(lldb_private::Status&, lldb::LanguageType, lldb_private::Debugger*, lldb_private::Target*, char const*), lldb_private::LanguageSet&)
Line
Count
Source
205
3.44k
                      Args &&...args) {
206
3.44k
    if (!callback)
207
0
      return false;
208
3.44k
    assert(!name.empty());
209
0
    Instance instance =
210
3.44k
        Instance(name, description, callback, std::forward<Args>(args)...);
211
3.44k
    m_instances.push_back(instance);
212
3.44k
    return false;
213
3.44k
  }
214
215
278k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
278k
    if (!callback)
217
0
      return false;
218
278k
    auto pos = m_instances.begin();
219
278k
    auto end = m_instances.end();
220
484k
    for (; pos != end; 
++pos205k
) {
221
484k
      if (pos->create_callback == callback) {
222
278k
        m_instances.erase(pos);
223
278k
        return true;
224
278k
      }
225
484k
    }
226
0
    return false;
227
278k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::ABI> (*)(std::__1::shared_ptr<lldb_private::Process>, lldb_private::ArchSpec const&)> >::UnregisterPlugin(std::__1::shared_ptr<lldb_private::ABI> (*)(std::__1::shared_ptr<lldb_private::Process>, lldb_private::ArchSpec const&))
Line
Count
Source
215
27.4k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
27.4k
    if (!callback)
217
0
      return false;
218
27.4k
    auto pos = m_instances.begin();
219
27.4k
    auto end = m_instances.end();
220
27.4k
    for (; pos != end; 
++pos0
) {
221
27.4k
      if (pos->create_callback == callback) {
222
27.4k
        m_instances.erase(pos);
223
27.4k
        return true;
224
27.4k
      }
225
27.4k
    }
226
0
    return false;
227
27.4k
  }
PluginInstances<PluginInstance<lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*)> >::UnregisterPlugin(lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*))
Line
Count
Source
215
3.44k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.44k
    if (!callback)
217
0
      return false;
218
3.44k
    auto pos = m_instances.begin();
219
3.44k
    auto end = m_instances.end();
220
3.44k
    for (; pos != end; 
++pos0
) {
221
3.44k
      if (pos->create_callback == callback) {
222
3.44k
        m_instances.erase(pos);
223
3.44k
        return true;
224
3.44k
      }
225
3.44k
    }
226
0
    return false;
227
3.44k
  }
PluginInstances<PluginInstance<lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool)> >::UnregisterPlugin(lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool))
Line
Count
Source
215
13.7k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
13.7k
    if (!callback)
217
0
      return false;
218
13.7k
    auto pos = m_instances.begin();
219
13.7k
    auto end = m_instances.end();
220
20.5k
    for (; pos != end; 
++pos6.86k
) {
221
20.5k
      if (pos->create_callback == callback) {
222
13.7k
        m_instances.erase(pos);
223
13.7k
        return true;
224
13.7k
      }
225
20.5k
    }
226
0
    return false;
227
13.7k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool)> >::UnregisterPlugin(std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool))
Line
Count
Source
215
3.43k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.43k
    if (!callback)
217
0
      return false;
218
3.43k
    auto pos = m_instances.begin();
219
3.43k
    auto end = m_instances.end();
220
3.43k
    for (; pos != end; 
++pos0
) {
221
3.43k
      if (pos->create_callback == callback) {
222
3.43k
        m_instances.erase(pos);
223
3.43k
        return true;
224
3.43k
      }
225
3.43k
    }
226
0
    return false;
227
3.43k
  }
PluginInstances<PluginInstance<lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType)> >::UnregisterPlugin(lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType))
Line
Count
Source
215
17.1k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
17.1k
    if (!callback)
217
0
      return false;
218
17.1k
    auto pos = m_instances.begin();
219
17.1k
    auto end = m_instances.end();
220
17.1k
    for (; pos != end; 
++pos0
) {
221
17.1k
      if (pos->create_callback == callback) {
222
17.1k
        m_instances.erase(pos);
223
17.1k
        return true;
224
17.1k
      }
225
17.1k
    }
226
0
    return false;
227
17.1k
  }
PluginInstances<PluginInstance<lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool)> >::UnregisterPlugin(lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool))
Line
Count
Source
215
3.43k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.43k
    if (!callback)
217
0
      return false;
218
3.43k
    auto pos = m_instances.begin();
219
3.43k
    auto end = m_instances.end();
220
3.43k
    for (; pos != end; 
++pos0
) {
221
3.43k
      if (pos->create_callback == callback) {
222
3.43k
        m_instances.erase(pos);
223
3.43k
        return true;
224
3.43k
      }
225
3.43k
    }
226
0
    return false;
227
3.43k
  }
PluginInstances<PluginInstance<lldb_private::Language* (*)(lldb::LanguageType)> >::UnregisterPlugin(lldb_private::Language* (*)(lldb::LanguageType))
Line
Count
Source
215
10.3k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
10.3k
    if (!callback)
217
0
      return false;
218
10.3k
    auto pos = m_instances.begin();
219
10.3k
    auto end = m_instances.end();
220
10.4k
    for (; pos != end; 
++pos90
) {
221
10.4k
      if (pos->create_callback == callback) {
222
10.3k
        m_instances.erase(pos);
223
10.3k
        return true;
224
10.3k
      }
225
10.4k
    }
226
0
    return false;
227
10.3k
  }
PluginInstances<LanguageRuntimeInstance>::UnregisterPlugin(lldb_private::LanguageRuntime* (*)(lldb_private::Process*, lldb::LanguageType))
Line
Count
Source
215
13.7k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
13.7k
    if (!callback)
217
0
      return false;
218
13.7k
    auto pos = m_instances.begin();
219
13.7k
    auto end = m_instances.end();
220
13.7k
    for (; pos != end; 
++pos0
) {
221
13.7k
      if (pos->create_callback == callback) {
222
13.7k
        m_instances.erase(pos);
223
13.7k
        return true;
224
13.7k
      }
225
13.7k
    }
226
0
    return false;
227
13.7k
  }
PluginInstances<PluginInstance<lldb_private::SystemRuntime* (*)(lldb_private::Process*)> >::UnregisterPlugin(lldb_private::SystemRuntime* (*)(lldb_private::Process*))
Line
Count
Source
215
3.43k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.43k
    if (!callback)
217
0
      return false;
218
3.43k
    auto pos = m_instances.begin();
219
3.43k
    auto end = m_instances.end();
220
3.43k
    for (; pos != end; 
++pos0
) {
221
3.43k
      if (pos->create_callback == callback) {
222
3.43k
        m_instances.erase(pos);
223
3.43k
        return true;
224
3.43k
      }
225
3.43k
    }
226
0
    return false;
227
3.43k
  }
PluginInstances<ObjectFileInstance>::UnregisterPlugin(lldb_private::ObjectFile* (*)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long))
Line
Count
Source
215
27.5k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
27.5k
    if (!callback)
217
0
      return false;
218
27.5k
    auto pos = m_instances.begin();
219
27.5k
    auto end = m_instances.end();
220
27.5k
    for (; pos != end; 
++pos0
) {
221
27.5k
      if (pos->create_callback == callback) {
222
27.5k
        m_instances.erase(pos);
223
27.5k
        return true;
224
27.5k
      }
225
27.5k
    }
226
0
    return false;
227
27.5k
  }
PluginInstances<ObjectContainerInstance>::UnregisterPlugin(lldb_private::ObjectContainer* (*)(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long))
Line
Count
Source
215
6.86k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
6.86k
    if (!callback)
217
0
      return false;
218
6.86k
    auto pos = m_instances.begin();
219
6.86k
    auto end = m_instances.end();
220
6.86k
    for (; pos != end; 
++pos0
) {
221
6.86k
      if (pos->create_callback == callback) {
222
6.86k
        m_instances.erase(pos);
223
6.86k
        return true;
224
6.86k
      }
225
6.86k
    }
226
0
    return false;
227
6.86k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::UnregisterPlugin(std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*))
Line
Count
Source
215
58.4k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
58.4k
    if (!callback)
217
0
      return false;
218
58.4k
    auto pos = m_instances.begin();
219
58.4k
    auto end = m_instances.end();
220
233k
    for (; pos != end; 
++pos175k
) {
221
233k
      if (pos->create_callback == callback) {
222
58.4k
        m_instances.erase(pos);
223
58.4k
        return true;
224
58.4k
      }
225
233k
    }
226
0
    return false;
227
58.4k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::UnregisterPlugin(std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool))
Line
Count
Source
215
23.9k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
23.9k
    if (!callback)
217
0
      return false;
218
23.9k
    auto pos = m_instances.begin();
219
23.9k
    auto end = m_instances.end();
220
43.9k
    for (; pos != end; 
++pos20.0k
) {
221
43.9k
      if (pos->create_callback == callback) {
222
23.9k
        m_instances.erase(pos);
223
23.9k
        return true;
224
23.9k
      }
225
43.9k
    }
226
0
    return false;
227
23.9k
  }
Unexecuted instantiation: PluginInstances<ScriptInterpreterInstance>::UnregisterPlugin(std::__1::shared_ptr<lldb_private::ScriptInterpreter> (*)(lldb_private::Debugger&))
PluginInstances<StructuredDataPluginInstance>::UnregisterPlugin(std::__1::shared_ptr<lldb_private::StructuredDataPlugin> (*)(lldb_private::Process&))
Line
Count
Source
215
3.43k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.43k
    if (!callback)
217
0
      return false;
218
3.43k
    auto pos = m_instances.begin();
219
3.43k
    auto end = m_instances.end();
220
3.43k
    for (; pos != end; 
++pos0
) {
221
3.43k
      if (pos->create_callback == callback) {
222
3.43k
        m_instances.erase(pos);
223
3.43k
        return true;
224
3.43k
      }
225
3.43k
    }
226
0
    return false;
227
3.43k
  }
PluginInstances<PluginInstance<lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>)> >::UnregisterPlugin(lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>))
Line
Count
Source
215
17.2k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
17.2k
    if (!callback)
217
0
      return false;
218
17.2k
    auto pos = m_instances.begin();
219
17.2k
    auto end = m_instances.end();
220
20.7k
    for (; pos != end; 
++pos3.48k
) {
221
20.7k
      if (pos->create_callback == callback) {
222
17.2k
        m_instances.erase(pos);
223
17.2k
        return true;
224
17.2k
      }
225
20.7k
    }
226
0
    return false;
227
17.2k
  }
PluginInstances<PluginInstance<lldb_private::SymbolVendor* (*)(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*)> >::UnregisterPlugin(lldb_private::SymbolVendor* (*)(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*))
Line
Count
Source
215
10.2k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
10.2k
    if (!callback)
217
0
      return false;
218
10.2k
    auto pos = m_instances.begin();
219
10.2k
    auto end = m_instances.end();
220
10.2k
    for (; pos != end; 
++pos0
) {
221
10.2k
      if (pos->create_callback == callback) {
222
10.2k
        m_instances.erase(pos);
223
10.2k
        return true;
224
10.2k
      }
225
10.2k
    }
226
0
    return false;
227
10.2k
  }
Unexecuted instantiation: PluginInstances<TraceInstance>::UnregisterPlugin(llvm::Expected<std::__1::shared_ptr<lldb_private::Trace> > (*)(llvm::json::Value const&, llvm::StringRef, lldb_private::Debugger&))
PluginInstances<TraceExporterInstance>::UnregisterPlugin(llvm::Expected<std::__1::unique_ptr<lldb_private::TraceExporter, std::__1::default_delete<lldb_private::TraceExporter> > > (*)())
Line
Count
Source
215
3.43k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.43k
    if (!callback)
217
0
      return false;
218
3.43k
    auto pos = m_instances.begin();
219
3.43k
    auto end = m_instances.end();
220
3.43k
    for (; pos != end; 
++pos0
) {
221
3.43k
      if (pos->create_callback == callback) {
222
3.43k
        m_instances.erase(pos);
223
3.43k
        return true;
224
3.43k
      }
225
3.43k
    }
226
0
    return false;
227
3.43k
  }
PluginInstances<PluginInstance<lldb_private::UnwindAssembly* (*)(lldb_private::ArchSpec const&)> >::UnregisterPlugin(lldb_private::UnwindAssembly* (*)(lldb_private::ArchSpec const&))
Line
Count
Source
215
6.86k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
6.86k
    if (!callback)
217
0
      return false;
218
6.86k
    auto pos = m_instances.begin();
219
6.86k
    auto end = m_instances.end();
220
6.86k
    for (; pos != end; 
++pos0
) {
221
6.86k
      if (pos->create_callback == callback) {
222
6.86k
        m_instances.erase(pos);
223
6.86k
        return true;
224
6.86k
      }
225
6.86k
    }
226
0
    return false;
227
6.86k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::MemoryHistory> (*)(std::__1::shared_ptr<lldb_private::Process> const&)> >::UnregisterPlugin(std::__1::shared_ptr<lldb_private::MemoryHistory> (*)(std::__1::shared_ptr<lldb_private::Process> const&))
Line
Count
Source
215
3.43k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.43k
    if (!callback)
217
0
      return false;
218
3.43k
    auto pos = m_instances.begin();
219
3.43k
    auto end = m_instances.end();
220
3.43k
    for (; pos != end; 
++pos0
) {
221
3.43k
      if (pos->create_callback == callback) {
222
3.43k
        m_instances.erase(pos);
223
3.43k
        return true;
224
3.43k
      }
225
3.43k
    }
226
0
    return false;
227
3.43k
  }
PluginInstances<InstrumentationRuntimeInstance>::UnregisterPlugin(std::__1::shared_ptr<lldb_private::InstrumentationRuntime> (*)(std::__1::shared_ptr<lldb_private::Process> const&))
Line
Count
Source
215
13.7k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
13.7k
    if (!callback)
217
0
      return false;
218
13.7k
    auto pos = m_instances.begin();
219
13.7k
    auto end = m_instances.end();
220
13.7k
    for (; pos != end; 
++pos0
) {
221
13.7k
      if (pos->create_callback == callback) {
222
13.7k
        m_instances.erase(pos);
223
13.7k
        return true;
224
13.7k
      }
225
13.7k
    }
226
0
    return false;
227
13.7k
  }
PluginInstances<TypeSystemInstance>::UnregisterPlugin(std::__1::shared_ptr<lldb_private::TypeSystem> (*)(lldb::LanguageType, lldb_private::Module*, lldb_private::Target*))
Line
Count
Source
215
3.46k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.46k
    if (!callback)
217
0
      return false;
218
3.46k
    auto pos = m_instances.begin();
219
3.46k
    auto end = m_instances.end();
220
3.46k
    for (; pos != end; 
++pos0
) {
221
3.46k
      if (pos->create_callback == callback) {
222
3.46k
        m_instances.erase(pos);
223
3.46k
        return true;
224
3.46k
      }
225
3.46k
    }
226
0
    return false;
227
3.46k
  }
PluginInstances<REPLInstance>::UnregisterPlugin(std::__1::shared_ptr<lldb_private::REPL> (*)(lldb_private::Status&, lldb::LanguageType, lldb_private::Debugger*, lldb_private::Target*, char const*))
Line
Count
Source
215
3.43k
  bool UnregisterPlugin(typename Instance::CallbackType callback) {
216
3.43k
    if (!callback)
217
0
      return false;
218
3.43k
    auto pos = m_instances.begin();
219
3.43k
    auto end = m_instances.end();
220
3.43k
    for (; pos != end; 
++pos0
) {
221
3.43k
      if (pos->create_callback == callback) {
222
3.43k
        m_instances.erase(pos);
223
3.43k
        return true;
224
3.43k
      }
225
3.43k
    }
226
0
    return false;
227
3.43k
  }
228
229
3.74M
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
3.74M
    if (Instance *instance = GetInstanceAtIndex(idx))
231
3.18M
      return instance->create_callback;
232
558k
    return nullptr;
233
3.74M
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::ABI> (*)(std::__1::shared_ptr<lldb_private::Process>, lldb_private::ArchSpec const&)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
38.3k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
38.3k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
38.3k
      return instance->create_callback;
232
48
    return nullptr;
233
38.3k
  }
PluginInstances<PluginInstance<lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
46.7k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
46.7k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
46.7k
      return instance->create_callback;
232
5
    return nullptr;
233
46.7k
  }
PluginInstances<PluginInstance<lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
8.11k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
8.11k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
8.11k
      return instance->create_callback;
232
0
    return nullptr;
233
8.11k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
5.45k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
5.45k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
2.72k
      return instance->create_callback;
232
2.72k
    return nullptr;
233
5.45k
  }
PluginInstances<PluginInstance<lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
126k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
126k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
105k
      return instance->create_callback;
232
21.0k
    return nullptr;
233
126k
  }
PluginInstances<PluginInstance<lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
28.5k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
28.5k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
14.2k
      return instance->create_callback;
232
14.2k
    return nullptr;
233
28.5k
  }
PluginInstances<PluginInstance<lldb_private::Language* (*)(lldb::LanguageType)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
696k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
696k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
524k
      return instance->create_callback;
232
172k
    return nullptr;
233
696k
  }
PluginInstances<LanguageRuntimeInstance>::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
1.00M
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
1.00M
    if (Instance *instance = GetInstanceAtIndex(idx))
231
809k
      return instance->create_callback;
232
199k
    return nullptr;
233
1.00M
  }
PluginInstances<PluginInstance<lldb_private::SystemRuntime* (*)(lldb_private::Process*)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
2.97k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
2.97k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
2.79k
      return instance->create_callback;
232
184
    return nullptr;
233
2.97k
  }
PluginInstances<ObjectFileInstance>::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
560k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
560k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
560k
      return instance->create_callback;
232
206
    return nullptr;
233
560k
  }
PluginInstances<ObjectContainerInstance>::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
1.20k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
1.20k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
1.00k
      return instance->create_callback;
232
207
    return nullptr;
233
1.20k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
1.63k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
1.63k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
1.55k
      return instance->create_callback;
232
77
    return nullptr;
233
1.63k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
770
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
770
    if (Instance *instance = GetInstanceAtIndex(idx))
231
768
      return instance->create_callback;
232
2
    return nullptr;
233
770
  }
Unexecuted instantiation: PluginInstances<ScriptInterpreterInstance>::GetCallbackAtIndex(unsigned int)
PluginInstances<StructuredDataPluginInstance>::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
2.58k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
2.58k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
2.58k
      return instance->create_callback;
232
0
    return nullptr;
233
2.58k
  }
PluginInstances<PluginInstance<lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
812k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
812k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
681k
      return instance->create_callback;
232
130k
    return nullptr;
233
812k
  }
PluginInstances<PluginInstance<lldb_private::SymbolVendor* (*)(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
301k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
301k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
294k
      return instance->create_callback;
232
6.27k
    return nullptr;
233
301k
  }
PluginInstances<PluginInstance<lldb_private::UnwindAssembly* (*)(lldb_private::ArchSpec const&)> >::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
42.0k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
42.0k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
42.0k
      return instance->create_callback;
232
0
    return nullptr;
233
42.0k
  }
Unexecuted instantiation: PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::MemoryHistory> (*)(std::__1::shared_ptr<lldb_private::Process> const&)> >::GetCallbackAtIndex(unsigned int)
PluginInstances<InstrumentationRuntimeInstance>::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
57.1k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
57.1k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
45.6k
      return instance->create_callback;
232
11.4k
    return nullptr;
233
57.1k
  }
PluginInstances<TypeSystemInstance>::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
5.41k
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
5.41k
    if (Instance *instance = GetInstanceAtIndex(idx))
231
5.40k
      return instance->create_callback;
232
7
    return nullptr;
233
5.41k
  }
PluginInstances<REPLInstance>::GetCallbackAtIndex(unsigned int)
Line
Count
Source
229
4
  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230
4
    if (Instance *instance = GetInstanceAtIndex(idx))
231
2
      return instance->create_callback;
232
2
    return nullptr;
233
4
  }
234
235
73
  llvm::StringRef GetDescriptionAtIndex(uint32_t idx) {
236
73
    if (Instance *instance = GetInstanceAtIndex(idx))
237
73
      return instance->description;
238
0
    return "";
239
73
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::GetDescriptionAtIndex(unsigned int)
Line
Count
Source
235
73
  llvm::StringRef GetDescriptionAtIndex(uint32_t idx) {
236
73
    if (Instance *instance = GetInstanceAtIndex(idx))
237
73
      return instance->description;
238
0
    return "";
239
73
  }
Unexecuted instantiation: PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::GetDescriptionAtIndex(unsigned int)
240
241
12.0k
  llvm::StringRef GetNameAtIndex(uint32_t idx) {
242
12.0k
    if (Instance *instance = GetInstanceAtIndex(idx))
243
6.06k
      return instance->name;
244
5.95k
    return "";
245
12.0k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::GetNameAtIndex(unsigned int)
Line
Count
Source
241
134
  llvm::StringRef GetNameAtIndex(uint32_t idx) {
242
134
    if (Instance *instance = GetInstanceAtIndex(idx))
243
127
      return instance->name;
244
7
    return "";
245
134
  }
Unexecuted instantiation: PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::GetNameAtIndex(unsigned int)
PluginInstances<TraceExporterInstance>::GetNameAtIndex(unsigned int)
Line
Count
Source
241
11.8k
  llvm::StringRef GetNameAtIndex(uint32_t idx) {
242
11.8k
    if (Instance *instance = GetInstanceAtIndex(idx))
243
5.94k
      return instance->name;
244
5.95k
    return "";
245
11.8k
  }
246
247
2.77k
  typename Instance::CallbackType GetCallbackForName(llvm::StringRef name) {
248
2.77k
    if (name.empty())
249
0
      return nullptr;
250
16.5k
    
for (auto &instance : m_instances)2.77k
{
251
16.5k
      if (name == instance.name)
252
2.77k
        return instance.create_callback;
253
16.5k
    }
254
1
    return nullptr;
255
2.77k
  }
Unexecuted instantiation: PluginInstances<PluginInstance<lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*)> >::GetCallbackForName(llvm::StringRef)
PluginInstances<PluginInstance<lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool)> >::GetCallbackForName(llvm::StringRef)
Line
Count
Source
247
59
  typename Instance::CallbackType GetCallbackForName(llvm::StringRef name) {
248
59
    if (name.empty())
249
0
      return nullptr;
250
243
    
for (auto &instance : m_instances)59
{
251
243
      if (name == instance.name)
252
59
        return instance.create_callback;
253
243
    }
254
0
    return nullptr;
255
59
  }
Unexecuted instantiation: PluginInstances<PluginInstance<lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType)> >::GetCallbackForName(llvm::StringRef)
Unexecuted instantiation: PluginInstances<PluginInstance<lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool)> >::GetCallbackForName(llvm::StringRef)
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::GetCallbackForName(llvm::StringRef)
Line
Count
Source
247
52
  typename Instance::CallbackType GetCallbackForName(llvm::StringRef name) {
248
52
    if (name.empty())
249
0
      return nullptr;
250
311
    
for (auto &instance : m_instances)52
{
251
311
      if (name == instance.name)
252
51
        return instance.create_callback;
253
311
    }
254
1
    return nullptr;
255
52
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::GetCallbackForName(llvm::StringRef)
Line
Count
Source
247
2.66k
  typename Instance::CallbackType GetCallbackForName(llvm::StringRef name) {
248
2.66k
    if (name.empty())
249
0
      return nullptr;
250
15.9k
    
for (auto &instance : m_instances)2.66k
{
251
15.9k
      if (name == instance.name)
252
2.66k
        return instance.create_callback;
253
15.9k
    }
254
0
    return nullptr;
255
2.66k
  }
Unexecuted instantiation: PluginInstances<TraceInstance>::GetCallbackForName(llvm::StringRef)
Unexecuted instantiation: PluginInstances<TraceExporterInstance>::GetCallbackForName(llvm::StringRef)
256
257
47.6k
  void PerformDebuggerCallback(Debugger &debugger) {
258
243k
    for (auto &instance : m_instances) {
259
243k
      if (instance.debugger_init_callback)
260
59.4k
        instance.debugger_init_callback(debugger);
261
243k
    }
262
47.6k
  }
PluginInstances<PluginInstance<lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool)> >::PerformDebuggerCallback(lldb_private::Debugger&)
Line
Count
Source
257
5.95k
  void PerformDebuggerCallback(Debugger &debugger) {
258
47.5k
    for (auto &instance : m_instances) {
259
47.5k
      if (instance.debugger_init_callback)
260
5.94k
        instance.debugger_init_callback(debugger);
261
47.5k
    }
262
5.95k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool)> >::PerformDebuggerCallback(lldb_private::Debugger&)
Line
Count
Source
257
5.95k
  void PerformDebuggerCallback(Debugger &debugger) {
258
5.95k
    for (auto &instance : m_instances) {
259
5.94k
      if (instance.debugger_init_callback)
260
5.94k
        instance.debugger_init_callback(debugger);
261
5.94k
    }
262
5.95k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::PerformDebuggerCallback(lldb_private::Debugger&)
Line
Count
Source
257
5.95k
  void PerformDebuggerCallback(Debugger &debugger) {
258
106k
    for (auto &instance : m_instances) {
259
106k
      if (instance.debugger_init_callback)
260
11.8k
        instance.debugger_init_callback(debugger);
261
106k
    }
262
5.95k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::PerformDebuggerCallback(lldb_private::Debugger&)
Line
Count
Source
257
5.95k
  void PerformDebuggerCallback(Debugger &debugger) {
258
41.5k
    for (auto &instance : m_instances) {
259
41.5k
      if (instance.debugger_init_callback)
260
11.8k
        instance.debugger_init_callback(debugger);
261
41.5k
    }
262
5.95k
  }
PluginInstances<PluginInstance<lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>)> >::PerformDebuggerCallback(lldb_private::Debugger&)
Line
Count
Source
257
5.95k
  void PerformDebuggerCallback(Debugger &debugger) {
258
29.7k
    for (auto &instance : m_instances) {
259
29.7k
      if (instance.debugger_init_callback)
260
17.8k
        instance.debugger_init_callback(debugger);
261
29.7k
    }
262
5.95k
  }
PluginInstances<PluginInstance<lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool)> >::PerformDebuggerCallback(lldb_private::Debugger&)
Line
Count
Source
257
5.95k
  void PerformDebuggerCallback(Debugger &debugger) {
258
5.95k
    for (auto &instance : m_instances) {
259
5.94k
      if (instance.debugger_init_callback)
260
0
        instance.debugger_init_callback(debugger);
261
5.94k
    }
262
5.95k
  }
PluginInstances<StructuredDataPluginInstance>::PerformDebuggerCallback(lldb_private::Debugger&)
Line
Count
Source
257
5.95k
  void PerformDebuggerCallback(Debugger &debugger) {
258
5.95k
    for (auto &instance : m_instances) {
259
5.94k
      if (instance.debugger_init_callback)
260
5.94k
        instance.debugger_init_callback(debugger);
261
5.94k
    }
262
5.95k
  }
PluginInstances<TraceInstance>::PerformDebuggerCallback(lldb_private::Debugger&)
Line
Count
Source
257
5.95k
  void PerformDebuggerCallback(Debugger &debugger) {
258
5.95k
    for (auto &instance : m_instances) {
259
0
      if (instance.debugger_init_callback)
260
0
        instance.debugger_init_callback(debugger);
261
0
    }
262
5.95k
  }
263
264
  const std::vector<Instance> &GetInstances() const { return m_instances; }
265
767k
  std::vector<Instance> &GetInstances() { return m_instances; }
PluginInstances<LanguageRuntimeInstance>::GetInstances()
Line
Count
Source
265
26.2k
  std::vector<Instance> &GetInstances() { return m_instances; }
PluginInstances<ObjectFileInstance>::GetInstances()
Line
Count
Source
265
596k
  std::vector<Instance> &GetInstances() { return m_instances; }
PluginInstances<ObjectContainerInstance>::GetInstances()
Line
Count
Source
265
5.36k
  std::vector<Instance> &GetInstances() { return m_instances; }
Unexecuted instantiation: PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::GetInstances()
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::GetInstances()
Line
Count
Source
265
3
  std::vector<Instance> &GetInstances() { return m_instances; }
PluginInstances<ScriptInterpreterInstance>::GetInstances()
Line
Count
Source
265
1.44k
  std::vector<Instance> &GetInstances() { return m_instances; }
PluginInstances<StructuredDataPluginInstance>::GetInstances()
Line
Count
Source
265
5.12k
  std::vector<Instance> &GetInstances() { return m_instances; }
Unexecuted instantiation: PluginInstances<TraceInstance>::GetInstances()
PluginInstances<InstrumentationRuntimeInstance>::GetInstances()
Line
Count
Source
265
45.6k
  std::vector<Instance> &GetInstances() { return m_instances; }
PluginInstances<TypeSystemInstance>::GetInstances()
Line
Count
Source
265
86.9k
  std::vector<Instance> &GetInstances() { return m_instances; }
PluginInstances<REPLInstance>::GetInstances()
Line
Count
Source
265
3
  std::vector<Instance> &GetInstances() { return m_instances; }
266
267
3.76M
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
3.76M
    if (idx < m_instances.size())
269
3.19M
      return &m_instances[idx];
270
570k
    return nullptr;
271
3.76M
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::ABI> (*)(std::__1::shared_ptr<lldb_private::Process>, lldb_private::ArchSpec const&)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
38.3k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
38.3k
    if (idx < m_instances.size())
269
38.3k
      return &m_instances[idx];
270
48
    return nullptr;
271
38.3k
  }
PluginInstances<PluginInstance<lldb_private::Disassembler* (*)(lldb_private::ArchSpec const&, char const*)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
46.7k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
46.7k
    if (idx < m_instances.size())
269
46.7k
      return &m_instances[idx];
270
5
    return nullptr;
271
46.7k
  }
PluginInstances<PluginInstance<lldb_private::DynamicLoader* (*)(lldb_private::Process*, bool)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
8.11k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
8.11k
    if (idx < m_instances.size())
269
8.11k
      return &m_instances[idx];
270
0
    return nullptr;
271
8.11k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::JITLoader> (*)(lldb_private::Process*, bool)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
5.45k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
5.45k
    if (idx < m_instances.size())
269
2.72k
      return &m_instances[idx];
270
2.72k
    return nullptr;
271
5.45k
  }
PluginInstances<PluginInstance<lldb_private::EmulateInstruction* (*)(lldb_private::ArchSpec const&, lldb_private::InstructionType)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
126k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
126k
    if (idx < m_instances.size())
269
105k
      return &m_instances[idx];
270
21.0k
    return nullptr;
271
126k
  }
PluginInstances<PluginInstance<lldb_private::OperatingSystem* (*)(lldb_private::Process*, bool)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
28.5k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
28.5k
    if (idx < m_instances.size())
269
14.2k
      return &m_instances[idx];
270
14.2k
    return nullptr;
271
28.5k
  }
PluginInstances<PluginInstance<lldb_private::Language* (*)(lldb::LanguageType)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
696k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
696k
    if (idx < m_instances.size())
269
524k
      return &m_instances[idx];
270
172k
    return nullptr;
271
696k
  }
PluginInstances<LanguageRuntimeInstance>::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
1.00M
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
1.00M
    if (idx < m_instances.size())
269
809k
      return &m_instances[idx];
270
199k
    return nullptr;
271
1.00M
  }
PluginInstances<PluginInstance<lldb_private::SystemRuntime* (*)(lldb_private::Process*)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
2.97k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
2.97k
    if (idx < m_instances.size())
269
2.79k
      return &m_instances[idx];
270
184
    return nullptr;
271
2.97k
  }
PluginInstances<ObjectFileInstance>::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
560k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
560k
    if (idx < m_instances.size())
269
560k
      return &m_instances[idx];
270
206
    return nullptr;
271
560k
  }
PluginInstances<ObjectContainerInstance>::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
1.20k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
1.20k
    if (idx < m_instances.size())
269
1.00k
      return &m_instances[idx];
270
207
    return nullptr;
271
1.20k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Platform> (*)(bool, lldb_private::ArchSpec const*)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
1.83k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
1.83k
    if (idx < m_instances.size())
269
1.75k
      return &m_instances[idx];
270
84
    return nullptr;
271
1.83k
  }
PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::Process> (*)(std::__1::shared_ptr<lldb_private::Target>, std::__1::shared_ptr<lldb_private::Listener>, lldb_private::FileSpec const*, bool)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
770
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
770
    if (idx < m_instances.size())
269
768
      return &m_instances[idx];
270
2
    return nullptr;
271
770
  }
Unexecuted instantiation: PluginInstances<ScriptInterpreterInstance>::GetInstanceAtIndex(unsigned int)
PluginInstances<StructuredDataPluginInstance>::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
2.58k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
2.58k
    if (idx < m_instances.size())
269
2.58k
      return &m_instances[idx];
270
0
    return nullptr;
271
2.58k
  }
PluginInstances<PluginInstance<lldb_private::SymbolFile* (*)(std::__1::shared_ptr<lldb_private::ObjectFile>)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
812k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
812k
    if (idx < m_instances.size())
269
681k
      return &m_instances[idx];
270
130k
    return nullptr;
271
812k
  }
PluginInstances<PluginInstance<lldb_private::SymbolVendor* (*)(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
301k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
301k
    if (idx < m_instances.size())
269
294k
      return &m_instances[idx];
270
6.27k
    return nullptr;
271
301k
  }
Unexecuted instantiation: PluginInstances<TraceInstance>::GetInstanceAtIndex(unsigned int)
PluginInstances<TraceExporterInstance>::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
17.8k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
17.8k
    if (idx < m_instances.size())
269
5.94k
      return &m_instances[idx];
270
11.8k
    return nullptr;
271
17.8k
  }
PluginInstances<PluginInstance<lldb_private::UnwindAssembly* (*)(lldb_private::ArchSpec const&)> >::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
42.0k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
42.0k
    if (idx < m_instances.size())
269
42.0k
      return &m_instances[idx];
270
0
    return nullptr;
271
42.0k
  }
Unexecuted instantiation: PluginInstances<PluginInstance<std::__1::shared_ptr<lldb_private::MemoryHistory> (*)(std::__1::shared_ptr<lldb_private::Process> const&)> >::GetInstanceAtIndex(unsigned int)
PluginInstances<InstrumentationRuntimeInstance>::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
57.1k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
57.1k
    if (idx < m_instances.size())
269
45.6k
      return &m_instances[idx];
270
11.4k
    return nullptr;
271
57.1k
  }
PluginInstances<TypeSystemInstance>::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
5.41k
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
5.41k
    if (idx < m_instances.size())
269
5.40k
      return &m_instances[idx];
270
7
    return nullptr;
271
5.41k
  }
PluginInstances<REPLInstance>::GetInstanceAtIndex(unsigned int)
Line
Count
Source
267
4
  Instance *GetInstanceAtIndex(uint32_t idx) {
268
4
    if (idx < m_instances.size())
269
2
      return &m_instances[idx];
270
2
    return nullptr;
271
4
  }
272
273
private:
274
  std::vector<Instance> m_instances;
275
};
276
277
#pragma mark ABI
278
279
typedef PluginInstance<ABICreateInstance> ABIInstance;
280
typedef PluginInstances<ABIInstance> ABIInstances;
281
282
93.3k
static ABIInstances &GetABIInstances() {
283
93.3k
  static ABIInstances g_instances;
284
93.3k
  return g_instances;
285
93.3k
}
286
287
bool PluginManager::RegisterPlugin(llvm::StringRef name,
288
                                   llvm::StringRef description,
289
27.5k
                                   ABICreateInstance create_callback) {
290
27.5k
  return GetABIInstances().RegisterPlugin(name, description, create_callback);
291
27.5k
}
292
293
27.4k
bool PluginManager::UnregisterPlugin(ABICreateInstance create_callback) {
294
27.4k
  return GetABIInstances().UnregisterPlugin(create_callback);
295
27.4k
}
296
297
38.3k
ABICreateInstance PluginManager::GetABICreateCallbackAtIndex(uint32_t idx) {
298
38.3k
  return GetABIInstances().GetCallbackAtIndex(idx);
299
38.3k
}
300
301
#pragma mark Architecture
302
303
typedef PluginInstance<ArchitectureCreateInstance> ArchitectureInstance;
304
typedef std::vector<ArchitectureInstance> ArchitectureInstances;
305
306
39.8k
static ArchitectureInstances &GetArchitectureInstances() {
307
39.8k
  static ArchitectureInstances g_instances;
308
39.8k
  return g_instances;
309
39.8k
}
310
311
void PluginManager::RegisterPlugin(llvm::StringRef name,
312
                                   llvm::StringRef description,
313
13.7k
                                   ArchitectureCreateInstance create_callback) {
314
13.7k
  GetArchitectureInstances().push_back({name, description, create_callback});
315
13.7k
}
316
317
void PluginManager::UnregisterPlugin(
318
13.7k
    ArchitectureCreateInstance create_callback) {
319
13.7k
  auto &instances = GetArchitectureInstances();
320
321
13.7k
  for (auto pos = instances.begin(), end = instances.end(); pos != end; 
++pos0
) {
322
13.7k
    if (pos->create_callback == create_callback) {
323
13.7k
      instances.erase(pos);
324
13.7k
      return;
325
13.7k
    }
326
13.7k
  }
327
0
  llvm_unreachable("Plugin not found");
328
0
}
329
330
std::unique_ptr<Architecture>
331
12.3k
PluginManager::CreateArchitectureInstance(const ArchSpec &arch) {
332
49.1k
  for (const auto &instances : GetArchitectureInstances()) {
333
49.1k
    if (auto plugin_up = instances.create_callback(arch))
334
95
      return plugin_up;
335
49.1k
  }
336
12.2k
  return nullptr;
337
12.3k
}
338
339
#pragma mark Disassembler
340
341
typedef PluginInstance<DisassemblerCreateInstance> DisassemblerInstance;
342
typedef PluginInstances<DisassemblerInstance> DisassemblerInstances;
343
344
53.6k
static DisassemblerInstances &GetDisassemblerInstances() {
345
53.6k
  static DisassemblerInstances g_instances;
346
53.6k
  return g_instances;
347
53.6k
}
348
349
bool PluginManager::RegisterPlugin(llvm::StringRef name,
350
                                   llvm::StringRef description,
351
3.44k
                                   DisassemblerCreateInstance create_callback) {
352
3.44k
  return GetDisassemblerInstances().RegisterPlugin(name, description,
353
3.44k
                                                   create_callback);
354
3.44k
}
355
356
bool PluginManager::UnregisterPlugin(
357
3.44k
    DisassemblerCreateInstance create_callback) {
358
3.44k
  return GetDisassemblerInstances().UnregisterPlugin(create_callback);
359
3.44k
}
360
361
DisassemblerCreateInstance
362
46.7k
PluginManager::GetDisassemblerCreateCallbackAtIndex(uint32_t idx) {
363
46.7k
  return GetDisassemblerInstances().GetCallbackAtIndex(idx);
364
46.7k
}
365
366
DisassemblerCreateInstance
367
PluginManager::GetDisassemblerCreateCallbackForPluginName(
368
0
    llvm::StringRef name) {
369
0
  return GetDisassemblerInstances().GetCallbackForName(name);
370
0
}
371
372
#pragma mark DynamicLoader
373
374
typedef PluginInstance<DynamicLoaderCreateInstance> DynamicLoaderInstance;
375
typedef PluginInstances<DynamicLoaderInstance> DynamicLoaderInstances;
376
377
55.3k
static DynamicLoaderInstances &GetDynamicLoaderInstances() {
378
55.3k
  static DynamicLoaderInstances g_instances;
379
55.3k
  return g_instances;
380
55.3k
}
381
382
bool PluginManager::RegisterPlugin(
383
    llvm::StringRef name, llvm::StringRef description,
384
    DynamicLoaderCreateInstance create_callback,
385
27.5k
    DebuggerInitializeCallback debugger_init_callback) {
386
27.5k
  return GetDynamicLoaderInstances().RegisterPlugin(
387
27.5k
      name, description, create_callback, debugger_init_callback);
388
27.5k
}
389
390
bool PluginManager::UnregisterPlugin(
391
13.7k
    DynamicLoaderCreateInstance create_callback) {
392
13.7k
  return GetDynamicLoaderInstances().UnregisterPlugin(create_callback);
393
13.7k
}
394
395
DynamicLoaderCreateInstance
396
8.11k
PluginManager::GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx) {
397
8.11k
  return GetDynamicLoaderInstances().GetCallbackAtIndex(idx);
398
8.11k
}
399
400
DynamicLoaderCreateInstance
401
PluginManager::GetDynamicLoaderCreateCallbackForPluginName(
402
59
    llvm::StringRef name) {
403
59
  return GetDynamicLoaderInstances().GetCallbackForName(name);
404
59
}
405
406
#pragma mark JITLoader
407
408
typedef PluginInstance<JITLoaderCreateInstance> JITLoaderInstance;
409
typedef PluginInstances<JITLoaderInstance> JITLoaderInstances;
410
411
18.2k
static JITLoaderInstances &GetJITLoaderInstances() {
412
18.2k
  static JITLoaderInstances g_instances;
413
18.2k
  return g_instances;
414
18.2k
}
415
416
bool PluginManager::RegisterPlugin(
417
    llvm::StringRef name, llvm::StringRef description,
418
    JITLoaderCreateInstance create_callback,
419
3.44k
    DebuggerInitializeCallback debugger_init_callback) {
420
3.44k
  return GetJITLoaderInstances().RegisterPlugin(
421
3.44k
      name, description, create_callback, debugger_init_callback);
422
3.44k
}
423
424
3.43k
bool PluginManager::UnregisterPlugin(JITLoaderCreateInstance create_callback) {
425
3.43k
  return GetJITLoaderInstances().UnregisterPlugin(create_callback);
426
3.43k
}
427
428
JITLoaderCreateInstance
429
5.45k
PluginManager::GetJITLoaderCreateCallbackAtIndex(uint32_t idx) {
430
5.45k
  return GetJITLoaderInstances().GetCallbackAtIndex(idx);
431
5.45k
}
432
433
#pragma mark EmulateInstruction
434
435
typedef PluginInstance<EmulateInstructionCreateInstance>
436
    EmulateInstructionInstance;
437
typedef PluginInstances<EmulateInstructionInstance> EmulateInstructionInstances;
438
439
160k
static EmulateInstructionInstances &GetEmulateInstructionInstances() {
440
160k
  static EmulateInstructionInstances g_instances;
441
160k
  return g_instances;
442
160k
}
443
444
bool PluginManager::RegisterPlugin(
445
    llvm::StringRef name, llvm::StringRef description,
446
17.2k
    EmulateInstructionCreateInstance create_callback) {
447
17.2k
  return GetEmulateInstructionInstances().RegisterPlugin(name, description,
448
17.2k
                                                         create_callback);
449
17.2k
}
450
451
bool PluginManager::UnregisterPlugin(
452
17.1k
    EmulateInstructionCreateInstance create_callback) {
453
17.1k
  return GetEmulateInstructionInstances().UnregisterPlugin(create_callback);
454
17.1k
}
455
456
EmulateInstructionCreateInstance
457
126k
PluginManager::GetEmulateInstructionCreateCallbackAtIndex(uint32_t idx) {
458
126k
  return GetEmulateInstructionInstances().GetCallbackAtIndex(idx);
459
126k
}
460
461
EmulateInstructionCreateInstance
462
PluginManager::GetEmulateInstructionCreateCallbackForPluginName(
463
0
    llvm::StringRef name) {
464
0
  return GetEmulateInstructionInstances().GetCallbackForName(name);
465
0
}
466
467
#pragma mark OperatingSystem
468
469
typedef PluginInstance<OperatingSystemCreateInstance> OperatingSystemInstance;
470
typedef PluginInstances<OperatingSystemInstance> OperatingSystemInstances;
471
472
41.3k
static OperatingSystemInstances &GetOperatingSystemInstances() {
473
41.3k
  static OperatingSystemInstances g_instances;
474
41.3k
  return g_instances;
475
41.3k
}
476
477
bool PluginManager::RegisterPlugin(
478
    llvm::StringRef name, llvm::StringRef description,
479
    OperatingSystemCreateInstance create_callback,
480
3.44k
    DebuggerInitializeCallback debugger_init_callback) {
481
3.44k
  return GetOperatingSystemInstances().RegisterPlugin(
482
3.44k
      name, description, create_callback, debugger_init_callback);
483
3.44k
}
484
485
bool PluginManager::UnregisterPlugin(
486
3.43k
    OperatingSystemCreateInstance create_callback) {
487
3.43k
  return GetOperatingSystemInstances().UnregisterPlugin(create_callback);
488
3.43k
}
489
490
OperatingSystemCreateInstance
491
28.5k
PluginManager::GetOperatingSystemCreateCallbackAtIndex(uint32_t idx) {
492
28.5k
  return GetOperatingSystemInstances().GetCallbackAtIndex(idx);
493
28.5k
}
494
495
OperatingSystemCreateInstance
496
PluginManager::GetOperatingSystemCreateCallbackForPluginName(
497
0
    llvm::StringRef name) {
498
0
  return GetOperatingSystemInstances().GetCallbackForName(name);
499
0
}
500
501
#pragma mark Language
502
503
typedef PluginInstance<LanguageCreateInstance> LanguageInstance;
504
typedef PluginInstances<LanguageInstance> LanguageInstances;
505
506
716k
static LanguageInstances &GetLanguageInstances() {
507
716k
  static LanguageInstances g_instances;
508
716k
  return g_instances;
509
716k
}
510
511
bool PluginManager::RegisterPlugin(llvm::StringRef name,
512
                                   llvm::StringRef description,
513
10.4k
                                   LanguageCreateInstance create_callback) {
514
10.4k
  return GetLanguageInstances().RegisterPlugin(name, description,
515
10.4k
                                               create_callback);
516
10.4k
}
517
518
10.3k
bool PluginManager::UnregisterPlugin(LanguageCreateInstance create_callback) {
519
10.3k
  return GetLanguageInstances().UnregisterPlugin(create_callback);
520
10.3k
}
521
522
LanguageCreateInstance
523
696k
PluginManager::GetLanguageCreateCallbackAtIndex(uint32_t idx) {
524
696k
  return GetLanguageInstances().GetCallbackAtIndex(idx);
525
696k
}
526
527
#pragma mark LanguageRuntime
528
529
struct LanguageRuntimeInstance
530
    : public PluginInstance<LanguageRuntimeCreateInstance> {
531
  LanguageRuntimeInstance(
532
      llvm::StringRef name, llvm::StringRef description,
533
      CallbackType create_callback,
534
      DebuggerInitializeCallback debugger_init_callback,
535
      LanguageRuntimeGetCommandObject command_callback,
536
      LanguageRuntimeGetExceptionPrecondition precondition_callback)
537
      : PluginInstance<LanguageRuntimeCreateInstance>(
538
            name, description, create_callback, debugger_init_callback),
539
        command_callback(command_callback),
540
13.7k
        precondition_callback(precondition_callback) {}
541
542
  LanguageRuntimeGetCommandObject command_callback;
543
  LanguageRuntimeGetExceptionPrecondition precondition_callback;
544
};
545
546
typedef PluginInstances<LanguageRuntimeInstance> LanguageRuntimeInstances;
547
548
1.06M
static LanguageRuntimeInstances &GetLanguageRuntimeInstances() {
549
1.06M
  static LanguageRuntimeInstances g_instances;
550
1.06M
  return g_instances;
551
1.06M
}
552
553
bool PluginManager::RegisterPlugin(
554
    llvm::StringRef name, llvm::StringRef description,
555
    LanguageRuntimeCreateInstance create_callback,
556
    LanguageRuntimeGetCommandObject command_callback,
557
13.7k
    LanguageRuntimeGetExceptionPrecondition precondition_callback) {
558
13.7k
  return GetLanguageRuntimeInstances().RegisterPlugin(
559
13.7k
      name, description, create_callback, nullptr, command_callback,
560
13.7k
      precondition_callback);
561
13.7k
}
562
563
bool PluginManager::UnregisterPlugin(
564
13.7k
    LanguageRuntimeCreateInstance create_callback) {
565
13.7k
  return GetLanguageRuntimeInstances().UnregisterPlugin(create_callback);
566
13.7k
}
567
568
LanguageRuntimeCreateInstance
569
1.00M
PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(uint32_t idx) {
570
1.00M
  return GetLanguageRuntimeInstances().GetCallbackAtIndex(idx);
571
1.00M
}
572
573
LanguageRuntimeGetCommandObject
574
23.7k
PluginManager::GetLanguageRuntimeGetCommandObjectAtIndex(uint32_t idx) {
575
23.7k
  const auto &instances = GetLanguageRuntimeInstances().GetInstances();
576
23.7k
  if (idx < instances.size())
577
23.7k
    return instances[idx].command_callback;
578
0
  return nullptr;
579
23.7k
}
580
581
LanguageRuntimeGetExceptionPrecondition
582
2.50k
PluginManager::GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx) {
583
2.50k
  const auto &instances = GetLanguageRuntimeInstances().GetInstances();
584
2.50k
  if (idx < instances.size())
585
2.50k
    return instances[idx].precondition_callback;
586
0
  return nullptr;
587
2.50k
}
588
589
#pragma mark SystemRuntime
590
591
typedef PluginInstance<SystemRuntimeCreateInstance> SystemRuntimeInstance;
592
typedef PluginInstances<SystemRuntimeInstance> SystemRuntimeInstances;
593
594
9.84k
static SystemRuntimeInstances &GetSystemRuntimeInstances() {
595
9.84k
  static SystemRuntimeInstances g_instances;
596
9.84k
  return g_instances;
597
9.84k
}
598
599
bool PluginManager::RegisterPlugin(
600
    llvm::StringRef name, llvm::StringRef description,
601
3.44k
    SystemRuntimeCreateInstance create_callback) {
602
3.44k
  return GetSystemRuntimeInstances().RegisterPlugin(name, description,
603
3.44k
                                                    create_callback);
604
3.44k
}
605
606
bool PluginManager::UnregisterPlugin(
607
3.43k
    SystemRuntimeCreateInstance create_callback) {
608
3.43k
  return GetSystemRuntimeInstances().UnregisterPlugin(create_callback);
609
3.43k
}
610
611
SystemRuntimeCreateInstance
612
2.97k
PluginManager::GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx) {
613
2.97k
  return GetSystemRuntimeInstances().GetCallbackAtIndex(idx);
614
2.97k
}
615
616
#pragma mark ObjectFile
617
618
struct ObjectFileInstance : public PluginInstance<ObjectFileCreateInstance> {
619
  ObjectFileInstance(
620
      llvm::StringRef name, llvm::StringRef description,
621
      CallbackType create_callback,
622
      ObjectFileCreateMemoryInstance create_memory_callback,
623
      ObjectFileGetModuleSpecifications get_module_specifications,
624
      ObjectFileSaveCore save_core)
625
      : PluginInstance<ObjectFileCreateInstance>(name, description,
626
                                                 create_callback),
627
        create_memory_callback(create_memory_callback),
628
        get_module_specifications(get_module_specifications),
629
27.5k
        save_core(save_core) {}
630
631
  ObjectFileCreateMemoryInstance create_memory_callback;
632
  ObjectFileGetModuleSpecifications get_module_specifications;
633
  ObjectFileSaveCore save_core;
634
};
635
typedef PluginInstances<ObjectFileInstance> ObjectFileInstances;
636
637
1.21M
static ObjectFileInstances &GetObjectFileInstances() {
638
1.21M
  static ObjectFileInstances g_instances;
639
1.21M
  return g_instances;
640
1.21M
}
641
642
bool PluginManager::RegisterPlugin(
643
    llvm::StringRef name, llvm::StringRef description,
644
    ObjectFileCreateInstance create_callback,
645
    ObjectFileCreateMemoryInstance create_memory_callback,
646
    ObjectFileGetModuleSpecifications get_module_specifications,
647
27.5k
    ObjectFileSaveCore save_core) {
648
27.5k
  return GetObjectFileInstances().RegisterPlugin(
649
27.5k
      name, description, create_callback, create_memory_callback,
650
27.5k
      get_module_specifications, save_core);
651
27.5k
}
652
653
27.5k
bool PluginManager::UnregisterPlugin(ObjectFileCreateInstance create_callback) {
654
27.5k
  return GetObjectFileInstances().UnregisterPlugin(create_callback);
655
27.5k
}
656
657
ObjectFileCreateInstance
658
560k
PluginManager::GetObjectFileCreateCallbackAtIndex(uint32_t idx) {
659
560k
  return GetObjectFileInstances().GetCallbackAtIndex(idx);
660
560k
}
661
662
ObjectFileCreateMemoryInstance
663
52
PluginManager::GetObjectFileCreateMemoryCallbackAtIndex(uint32_t idx) {
664
52
  const auto &instances = GetObjectFileInstances().GetInstances();
665
52
  if (idx < instances.size())
666
52
    return instances[idx].create_memory_callback;
667
0
  return nullptr;
668
52
}
669
670
ObjectFileGetModuleSpecifications
671
PluginManager::GetObjectFileGetModuleSpecificationsCallbackAtIndex(
672
596k
    uint32_t idx) {
673
596k
  const auto &instances = GetObjectFileInstances().GetInstances();
674
596k
  if (idx < instances.size())
675
594k
    return instances[idx].get_module_specifications;
676
2.67k
  return nullptr;
677
596k
}
678
679
ObjectFileCreateMemoryInstance
680
PluginManager::GetObjectFileCreateMemoryCallbackForPluginName(
681
0
    llvm::StringRef name) {
682
0
  const auto &instances = GetObjectFileInstances().GetInstances();
683
0
  for (auto &instance : instances) {
684
0
    if (instance.name == name)
685
0
      return instance.create_memory_callback;
686
0
  }
687
0
  return nullptr;
688
0
}
689
690
Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp,
691
                               const FileSpec &outfile,
692
                               lldb::SaveCoreStyle &core_style,
693
0
                               llvm::StringRef plugin_name) {
694
0
  if (plugin_name.empty()) {
695
    // Try saving core directly from the process plugin first.
696
0
    llvm::Expected<bool> ret = process_sp->SaveCore(outfile.GetPath());
697
0
    if (!ret)
698
0
      return Status(ret.takeError());
699
0
    if (ret.get())
700
0
      return Status();
701
0
  }
702
703
  // Fall back to object plugins.
704
0
  Status error;
705
0
  auto &instances = GetObjectFileInstances().GetInstances();
706
0
  for (auto &instance : instances) {
707
0
    if (plugin_name.empty() || instance.name == plugin_name) {
708
0
      if (instance.save_core &&
709
0
          instance.save_core(process_sp, outfile, core_style, error))
710
0
        return error;
711
0
    }
712
0
  }
713
0
  error.SetErrorString(
714
0
      "no ObjectFile plugins were able to save a core for this process");
715
0
  return error;
716
0
}
717
718
#pragma mark ObjectContainer
719
720
struct ObjectContainerInstance
721
    : public PluginInstance<ObjectContainerCreateInstance> {
722
  ObjectContainerInstance(
723
      llvm::StringRef name, llvm::StringRef description,
724
      CallbackType create_callback,
725
      ObjectFileGetModuleSpecifications get_module_specifications)
726
      : PluginInstance<ObjectContainerCreateInstance>(name, description,
727
                                                      create_callback),
728
6.88k
        get_module_specifications(get_module_specifications) {}
729
730
  ObjectFileGetModuleSpecifications get_module_specifications;
731
};
732
typedef PluginInstances<ObjectContainerInstance> ObjectContainerInstances;
733
734
20.3k
static ObjectContainerInstances &GetObjectContainerInstances() {
735
20.3k
  static ObjectContainerInstances g_instances;
736
20.3k
  return g_instances;
737
20.3k
}
738
739
bool PluginManager::RegisterPlugin(
740
    llvm::StringRef name, llvm::StringRef description,
741
    ObjectContainerCreateInstance create_callback,
742
6.88k
    ObjectFileGetModuleSpecifications get_module_specifications) {
743
6.88k
  return GetObjectContainerInstances().RegisterPlugin(
744
6.88k
      name, description, create_callback, get_module_specifications);
745
6.88k
}
746
747
bool PluginManager::UnregisterPlugin(
748
6.86k
    ObjectContainerCreateInstance create_callback) {
749
6.86k
  return GetObjectContainerInstances().UnregisterPlugin(create_callback);
750
6.86k
}
751
752
ObjectContainerCreateInstance
753
1.20k
PluginManager::GetObjectContainerCreateCallbackAtIndex(uint32_t idx) {
754
1.20k
  return GetObjectContainerInstances().GetCallbackAtIndex(idx);
755
1.20k
}
756
757
ObjectFileGetModuleSpecifications
758
PluginManager::GetObjectContainerGetModuleSpecificationsCallbackAtIndex(
759
5.36k
    uint32_t idx) {
760
5.36k
  const auto &instances = GetObjectContainerInstances().GetInstances();
761
5.36k
  if (idx < instances.size())
762
5.35k
    return instances[idx].get_module_specifications;
763
18
  return nullptr;
764
5.36k
}
765
766
#pragma mark Platform
767
768
typedef PluginInstance<PlatformCreateInstance> PlatformInstance;
769
typedef PluginInstances<PlatformInstance> PlatformInstances;
770
771
128k
static PlatformInstances &GetPlatformInstances() {
772
128k
  static PlatformInstances g_platform_instances;
773
128k
  return g_platform_instances;
774
128k
}
775
776
bool PluginManager::RegisterPlugin(
777
    llvm::StringRef name, llvm::StringRef description,
778
    PlatformCreateInstance create_callback,
779
61.9k
    DebuggerInitializeCallback debugger_init_callback) {
780
61.9k
  return GetPlatformInstances().RegisterPlugin(
781
61.9k
      name, description, create_callback, debugger_init_callback);
782
61.9k
}
783
784
58.4k
bool PluginManager::UnregisterPlugin(PlatformCreateInstance create_callback) {
785
58.4k
  return GetPlatformInstances().UnregisterPlugin(create_callback);
786
58.4k
}
787
788
134
llvm::StringRef PluginManager::GetPlatformPluginNameAtIndex(uint32_t idx) {
789
134
  return GetPlatformInstances().GetNameAtIndex(idx);
790
134
}
791
792
llvm::StringRef
793
73
PluginManager::GetPlatformPluginDescriptionAtIndex(uint32_t idx) {
794
73
  return GetPlatformInstances().GetDescriptionAtIndex(idx);
795
73
}
796
797
PlatformCreateInstance
798
1.63k
PluginManager::GetPlatformCreateCallbackAtIndex(uint32_t idx) {
799
1.63k
  return GetPlatformInstances().GetCallbackAtIndex(idx);
800
1.63k
}
801
802
PlatformCreateInstance
803
52
PluginManager::GetPlatformCreateCallbackForPluginName(llvm::StringRef name) {
804
52
  return GetPlatformInstances().GetCallbackForName(name);
805
52
}
806
807
void PluginManager::AutoCompletePlatformName(llvm::StringRef name,
808
0
                                             CompletionRequest &request) {
809
0
  for (const auto &instance : GetPlatformInstances().GetInstances()) {
810
0
    if (instance.name.startswith(name))
811
0
      request.AddCompletion(instance.name);
812
0
  }
813
0
}
814
815
#pragma mark Process
816
817
typedef PluginInstance<ProcessCreateInstance> ProcessInstance;
818
typedef PluginInstances<ProcessInstance> ProcessInstances;
819
820
57.3k
static ProcessInstances &GetProcessInstances() {
821
57.3k
  static ProcessInstances g_instances;
822
57.3k
  return g_instances;
823
57.3k
}
824
825
bool PluginManager::RegisterPlugin(
826
    llvm::StringRef name, llvm::StringRef description,
827
    ProcessCreateInstance create_callback,
828
23.9k
    DebuggerInitializeCallback debugger_init_callback) {
829
23.9k
  return GetProcessInstances().RegisterPlugin(
830
23.9k
      name, description, create_callback, debugger_init_callback);
831
23.9k
}
832
833
23.9k
bool PluginManager::UnregisterPlugin(ProcessCreateInstance create_callback) {
834
23.9k
  return GetProcessInstances().UnregisterPlugin(create_callback);
835
23.9k
}
836
837
0
llvm::StringRef PluginManager::GetProcessPluginNameAtIndex(uint32_t idx) {
838
0
  return GetProcessInstances().GetNameAtIndex(idx);
839
0
}
840
841
0
llvm::StringRef PluginManager::GetProcessPluginDescriptionAtIndex(uint32_t idx) {
842
0
  return GetProcessInstances().GetDescriptionAtIndex(idx);
843
0
}
844
845
ProcessCreateInstance
846
770
PluginManager::GetProcessCreateCallbackAtIndex(uint32_t idx) {
847
770
  return GetProcessInstances().GetCallbackAtIndex(idx);
848
770
}
849
850
ProcessCreateInstance
851
2.66k
PluginManager::GetProcessCreateCallbackForPluginName(llvm::StringRef name) {
852
2.66k
  return GetProcessInstances().GetCallbackForName(name);
853
2.66k
}
854
855
void PluginManager::AutoCompleteProcessName(llvm::StringRef name,
856
3
                                            CompletionRequest &request) {
857
21
  for (const auto &instance : GetProcessInstances().GetInstances()) {
858
21
    if (instance.name.startswith(name))
859
3
      request.AddCompletion(instance.name, instance.description);
860
21
  }
861
3
}
862
863
#pragma mark ScriptInterpreter
864
865
struct ScriptInterpreterInstance
866
    : public PluginInstance<ScriptInterpreterCreateInstance> {
867
  ScriptInterpreterInstance(llvm::StringRef name, llvm::StringRef description,
868
                            CallbackType create_callback,
869
                            lldb::ScriptLanguage language)
870
      : PluginInstance<ScriptInterpreterCreateInstance>(name, description,
871
                                                        create_callback),
872
6.79k
        language(language) {}
873
874
  lldb::ScriptLanguage language = lldb::eScriptLanguageNone;
875
};
876
877
typedef PluginInstances<ScriptInterpreterInstance> ScriptInterpreterInstances;
878
879
8.23k
static ScriptInterpreterInstances &GetScriptInterpreterInstances() {
880
8.23k
  static ScriptInterpreterInstances g_instances;
881
8.23k
  return g_instances;
882
8.23k
}
883
884
bool PluginManager::RegisterPlugin(
885
    llvm::StringRef name, llvm::StringRef description,
886
    lldb::ScriptLanguage script_language,
887
6.79k
    ScriptInterpreterCreateInstance create_callback) {
888
6.79k
  return GetScriptInterpreterInstances().RegisterPlugin(
889
6.79k
      name, description, create_callback, script_language);
890
6.79k
}
891
892
bool PluginManager::UnregisterPlugin(
893
0
    ScriptInterpreterCreateInstance create_callback) {
894
0
  return GetScriptInterpreterInstances().UnregisterPlugin(create_callback);
895
0
}
896
897
ScriptInterpreterCreateInstance
898
0
PluginManager::GetScriptInterpreterCreateCallbackAtIndex(uint32_t idx) {
899
0
  return GetScriptInterpreterInstances().GetCallbackAtIndex(idx);
900
0
}
901
902
lldb::ScriptInterpreterSP
903
PluginManager::GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang,
904
1.44k
                                               Debugger &debugger) {
905
1.44k
  const auto &instances = GetScriptInterpreterInstances().GetInstances();
906
1.44k
  ScriptInterpreterCreateInstance none_instance = nullptr;
907
2.87k
  for (const auto &instance : instances) {
908
2.87k
    if (instance.language == lldb::eScriptLanguageNone)
909
1.44k
      none_instance = instance.create_callback;
910
911
2.87k
    if (script_lang == instance.language)
912
1.43k
      return instance.create_callback(debugger);
913
2.87k
  }
914
915
  // If we didn't find one, return the ScriptInterpreter for the null language.
916
6
  assert(none_instance != nullptr);
917
0
  return none_instance(debugger);
918
1.44k
}
919
920
#pragma mark StructuredDataPlugin
921
922
struct StructuredDataPluginInstance
923
    : public PluginInstance<StructuredDataPluginCreateInstance> {
924
  StructuredDataPluginInstance(
925
      llvm::StringRef name, llvm::StringRef description,
926
      CallbackType create_callback,
927
      DebuggerInitializeCallback debugger_init_callback,
928
      StructuredDataFilterLaunchInfo filter_callback)
929
      : PluginInstance<StructuredDataPluginCreateInstance>(
930
            name, description, create_callback, debugger_init_callback),
931
3.44k
        filter_callback(filter_callback) {}
932
933
  StructuredDataFilterLaunchInfo filter_callback = nullptr;
934
};
935
936
typedef PluginInstances<StructuredDataPluginInstance>
937
    StructuredDataPluginInstances;
938
939
20.5k
static StructuredDataPluginInstances &GetStructuredDataPluginInstances() {
940
20.5k
  static StructuredDataPluginInstances g_instances;
941
20.5k
  return g_instances;
942
20.5k
}
943
944
bool PluginManager::RegisterPlugin(
945
    llvm::StringRef name, llvm::StringRef description,
946
    StructuredDataPluginCreateInstance create_callback,
947
    DebuggerInitializeCallback debugger_init_callback,
948
3.44k
    StructuredDataFilterLaunchInfo filter_callback) {
949
3.44k
  return GetStructuredDataPluginInstances().RegisterPlugin(
950
3.44k
      name, description, create_callback, debugger_init_callback,
951
3.44k
      filter_callback);
952
3.44k
}
953
954
bool PluginManager::UnregisterPlugin(
955
3.43k
    StructuredDataPluginCreateInstance create_callback) {
956
3.43k
  return GetStructuredDataPluginInstances().UnregisterPlugin(create_callback);
957
3.43k
}
958
959
StructuredDataPluginCreateInstance
960
2.58k
PluginManager::GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx) {
961
2.58k
  return GetStructuredDataPluginInstances().GetCallbackAtIndex(idx);
962
2.58k
}
963
964
StructuredDataFilterLaunchInfo
965
PluginManager::GetStructuredDataFilterCallbackAtIndex(
966
5.12k
    uint32_t idx, bool &iteration_complete) {
967
5.12k
  const auto &instances = GetStructuredDataPluginInstances().GetInstances();
968
5.12k
  if (idx < instances.size()) {
969
2.56k
    iteration_complete = false;
970
2.56k
    return instances[idx].filter_callback;
971
2.56k
  } else {
972
2.56k
    iteration_complete = true;
973
2.56k
  }
974
2.56k
  return nullptr;
975
5.12k
}
976
977
#pragma mark SymbolFile
978
979
typedef PluginInstance<SymbolFileCreateInstance> SymbolFileInstance;
980
typedef PluginInstances<SymbolFileInstance> SymbolFileInstances;
981
982
852k
static SymbolFileInstances &GetSymbolFileInstances() {
983
852k
  static SymbolFileInstances g_instances;
984
852k
  return g_instances;
985
852k
}
986
987
bool PluginManager::RegisterPlugin(
988
    llvm::StringRef name, llvm::StringRef description,
989
    SymbolFileCreateInstance create_callback,
990
17.2k
    DebuggerInitializeCallback debugger_init_callback) {
991
17.2k
  return GetSymbolFileInstances().RegisterPlugin(
992
17.2k
      name, description, create_callback, debugger_init_callback);
993
17.2k
}
994
995
17.2k
bool PluginManager::UnregisterPlugin(SymbolFileCreateInstance create_callback) {
996
17.2k
  return GetSymbolFileInstances().UnregisterPlugin(create_callback);
997
17.2k
}
998
999
SymbolFileCreateInstance
1000
812k
PluginManager::GetSymbolFileCreateCallbackAtIndex(uint32_t idx) {
1001
812k
  return GetSymbolFileInstances().GetCallbackAtIndex(idx);
1002
812k
}
1003
1004
#pragma mark SymbolVendor
1005
1006
typedef PluginInstance<SymbolVendorCreateInstance> SymbolVendorInstance;
1007
typedef PluginInstances<SymbolVendorInstance> SymbolVendorInstances;
1008
1009
321k
static SymbolVendorInstances &GetSymbolVendorInstances() {
1010
321k
  static SymbolVendorInstances g_instances;
1011
321k
  return g_instances;
1012
321k
}
1013
1014
bool PluginManager::RegisterPlugin(llvm::StringRef name,
1015
                                   llvm::StringRef description,
1016
10.3k
                                   SymbolVendorCreateInstance create_callback) {
1017
10.3k
  return GetSymbolVendorInstances().RegisterPlugin(name, description,
1018
10.3k
                                                   create_callback);
1019
10.3k
}
1020
1021
bool PluginManager::UnregisterPlugin(
1022
10.2k
    SymbolVendorCreateInstance create_callback) {
1023
10.2k
  return GetSymbolVendorInstances().UnregisterPlugin(create_callback);
1024
10.2k
}
1025
1026
SymbolVendorCreateInstance
1027
301k
PluginManager::GetSymbolVendorCreateCallbackAtIndex(uint32_t idx) {
1028
301k
  return GetSymbolVendorInstances().GetCallbackAtIndex(idx);
1029
301k
}
1030
1031
#pragma mark Trace
1032
1033
struct TraceInstance
1034
    : public PluginInstance<TraceCreateInstanceForSessionFile> {
1035
  TraceInstance(
1036
      llvm::StringRef name, llvm::StringRef description,
1037
      CallbackType create_callback_for_session_file,
1038
      TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1039
      llvm::StringRef schema)
1040
      : PluginInstance<TraceCreateInstanceForSessionFile>(
1041
            name, description, create_callback_for_session_file),
1042
        schema(schema),
1043
0
        create_callback_for_live_process(create_callback_for_live_process) {}
1044
1045
  llvm::StringRef schema;
1046
  TraceCreateInstanceForLiveProcess create_callback_for_live_process;
1047
};
1048
1049
typedef PluginInstances<TraceInstance> TraceInstances;
1050
1051
5.95k
static TraceInstances &GetTracePluginInstances() {
1052
5.95k
  static TraceInstances g_instances;
1053
5.95k
  return g_instances;
1054
5.95k
}
1055
1056
bool PluginManager::RegisterPlugin(
1057
    llvm::StringRef name, llvm::StringRef description,
1058
    TraceCreateInstanceForSessionFile create_callback_for_session_file,
1059
    TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1060
0
    llvm::StringRef schema) {
1061
0
  return GetTracePluginInstances().RegisterPlugin(
1062
0
      name, description, create_callback_for_session_file,
1063
0
      create_callback_for_live_process, schema);
1064
0
}
1065
1066
bool PluginManager::UnregisterPlugin(
1067
0
    TraceCreateInstanceForSessionFile create_callback_for_session_file) {
1068
0
  return GetTracePluginInstances().UnregisterPlugin(
1069
0
      create_callback_for_session_file);
1070
0
}
1071
1072
TraceCreateInstanceForSessionFile
1073
0
PluginManager::GetTraceCreateCallback(llvm::StringRef plugin_name) {
1074
0
  return GetTracePluginInstances().GetCallbackForName(plugin_name);
1075
0
}
1076
1077
TraceCreateInstanceForLiveProcess
1078
0
PluginManager::GetTraceCreateCallbackForLiveProcess(llvm::StringRef plugin_name) {
1079
0
  for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1080
0
    if (instance.name == plugin_name)
1081
0
      return instance.create_callback_for_live_process;
1082
0
  return nullptr;
1083
0
}
1084
1085
0
llvm::StringRef PluginManager::GetTraceSchema(llvm::StringRef plugin_name) {
1086
0
  for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1087
0
    if (instance.name == plugin_name)
1088
0
      return instance.schema;
1089
0
  return llvm::StringRef();
1090
0
}
1091
1092
0
llvm::StringRef PluginManager::GetTraceSchema(size_t index) {
1093
0
  if (TraceInstance *instance =
1094
0
          GetTracePluginInstances().GetInstanceAtIndex(index))
1095
0
    return instance->schema;
1096
0
  return llvm::StringRef();
1097
0
}
1098
1099
#pragma mark TraceExporter
1100
1101
struct TraceExporterInstance
1102
    : public PluginInstance<TraceExporterCreateInstance> {
1103
  TraceExporterInstance(
1104
      llvm::StringRef name, llvm::StringRef description,
1105
      TraceExporterCreateInstance create_instance,
1106
      ThreadTraceExportCommandCreator create_thread_trace_export_command)
1107
      : PluginInstance<TraceExporterCreateInstance>(name, description,
1108
                                                    create_instance),
1109
3.44k
        create_thread_trace_export_command(create_thread_trace_export_command) {
1110
3.44k
  }
1111
1112
  ThreadTraceExportCommandCreator create_thread_trace_export_command;
1113
};
1114
1115
typedef PluginInstances<TraceExporterInstance> TraceExporterInstances;
1116
1117
24.7k
static TraceExporterInstances &GetTraceExporterInstances() {
1118
24.7k
  static TraceExporterInstances g_instances;
1119
24.7k
  return g_instances;
1120
24.7k
}
1121
1122
bool PluginManager::RegisterPlugin(
1123
    llvm::StringRef name, llvm::StringRef description,
1124
    TraceExporterCreateInstance create_callback,
1125
3.44k
    ThreadTraceExportCommandCreator create_thread_trace_export_command) {
1126
3.44k
  return GetTraceExporterInstances().RegisterPlugin(
1127
3.44k
      name, description, create_callback, create_thread_trace_export_command);
1128
3.44k
}
1129
1130
TraceExporterCreateInstance
1131
0
PluginManager::GetTraceExporterCreateCallback(llvm::StringRef plugin_name) {
1132
0
  return GetTraceExporterInstances().GetCallbackForName(plugin_name);
1133
0
}
1134
1135
bool PluginManager::UnregisterPlugin(
1136
3.43k
    TraceExporterCreateInstance create_callback) {
1137
3.43k
  return GetTraceExporterInstances().UnregisterPlugin(create_callback);
1138
3.43k
}
1139
1140
ThreadTraceExportCommandCreator
1141
5.94k
PluginManager::GetThreadTraceExportCommandCreatorAtIndex(uint32_t index) {
1142
5.94k
  if (TraceExporterInstance *instance =
1143
5.94k
          GetTraceExporterInstances().GetInstanceAtIndex(index))
1144
0
    return instance->create_thread_trace_export_command;
1145
5.94k
  return nullptr;
1146
5.94k
}
1147
1148
llvm::StringRef
1149
11.8k
PluginManager::GetTraceExporterPluginNameAtIndex(uint32_t index) {
1150
11.8k
  return GetTraceExporterInstances().GetNameAtIndex(index);
1151
11.8k
}
1152
1153
#pragma mark UnwindAssembly
1154
1155
typedef PluginInstance<UnwindAssemblyCreateInstance> UnwindAssemblyInstance;
1156
typedef PluginInstances<UnwindAssemblyInstance> UnwindAssemblyInstances;
1157
1158
55.7k
static UnwindAssemblyInstances &GetUnwindAssemblyInstances() {
1159
55.7k
  static UnwindAssemblyInstances g_instances;
1160
55.7k
  return g_instances;
1161
55.7k
}
1162
1163
bool PluginManager::RegisterPlugin(
1164
    llvm::StringRef name, llvm::StringRef description,
1165
6.88k
    UnwindAssemblyCreateInstance create_callback) {
1166
6.88k
  return GetUnwindAssemblyInstances().RegisterPlugin(name, description,
1167
6.88k
                                                     create_callback);
1168
6.88k
}
1169
1170
bool PluginManager::UnregisterPlugin(
1171
6.86k
    UnwindAssemblyCreateInstance create_callback) {
1172
6.86k
  return GetUnwindAssemblyInstances().UnregisterPlugin(create_callback);
1173
6.86k
}
1174
1175
UnwindAssemblyCreateInstance
1176
42.0k
PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(uint32_t idx) {
1177
42.0k
  return GetUnwindAssemblyInstances().GetCallbackAtIndex(idx);
1178
42.0k
}
1179
1180
#pragma mark MemoryHistory
1181
1182
typedef PluginInstance<MemoryHistoryCreateInstance> MemoryHistoryInstance;
1183
typedef PluginInstances<MemoryHistoryInstance> MemoryHistoryInstances;
1184
1185
6.87k
static MemoryHistoryInstances &GetMemoryHistoryInstances() {
1186
6.87k
  static MemoryHistoryInstances g_instances;
1187
6.87k
  return g_instances;
1188
6.87k
}
1189
1190
bool PluginManager::RegisterPlugin(
1191
    llvm::StringRef name, llvm::StringRef description,
1192
3.44k
    MemoryHistoryCreateInstance create_callback) {
1193
3.44k
  return GetMemoryHistoryInstances().RegisterPlugin(name, description,
1194
3.44k
                                                    create_callback);
1195
3.44k
}
1196
1197
bool PluginManager::UnregisterPlugin(
1198
3.43k
    MemoryHistoryCreateInstance create_callback) {
1199
3.43k
  return GetMemoryHistoryInstances().UnregisterPlugin(create_callback);
1200
3.43k
}
1201
1202
MemoryHistoryCreateInstance
1203
0
PluginManager::GetMemoryHistoryCreateCallbackAtIndex(uint32_t idx) {
1204
0
  return GetMemoryHistoryInstances().GetCallbackAtIndex(idx);
1205
0
}
1206
1207
#pragma mark InstrumentationRuntime
1208
1209
struct InstrumentationRuntimeInstance
1210
    : public PluginInstance<InstrumentationRuntimeCreateInstance> {
1211
  InstrumentationRuntimeInstance(
1212
      llvm::StringRef name, llvm::StringRef description,
1213
      CallbackType create_callback,
1214
      InstrumentationRuntimeGetType get_type_callback)
1215
      : PluginInstance<InstrumentationRuntimeCreateInstance>(name, description,
1216
                                                             create_callback),
1217
13.7k
        get_type_callback(get_type_callback) {}
1218
1219
  InstrumentationRuntimeGetType get_type_callback = nullptr;
1220
};
1221
1222
typedef PluginInstances<InstrumentationRuntimeInstance>
1223
    InstrumentationRuntimeInstances;
1224
1225
130k
static InstrumentationRuntimeInstances &GetInstrumentationRuntimeInstances() {
1226
130k
  static InstrumentationRuntimeInstances g_instances;
1227
130k
  return g_instances;
1228
130k
}
1229
1230
bool PluginManager::RegisterPlugin(
1231
    llvm::StringRef name, llvm::StringRef description,
1232
    InstrumentationRuntimeCreateInstance create_callback,
1233
13.7k
    InstrumentationRuntimeGetType get_type_callback) {
1234
13.7k
  return GetInstrumentationRuntimeInstances().RegisterPlugin(
1235
13.7k
      name, description, create_callback, get_type_callback);
1236
13.7k
}
1237
1238
bool PluginManager::UnregisterPlugin(
1239
13.7k
    InstrumentationRuntimeCreateInstance create_callback) {
1240
13.7k
  return GetInstrumentationRuntimeInstances().UnregisterPlugin(create_callback);
1241
13.7k
}
1242
1243
InstrumentationRuntimeGetType
1244
45.6k
PluginManager::GetInstrumentationRuntimeGetTypeCallbackAtIndex(uint32_t idx) {
1245
45.6k
  const auto &instances = GetInstrumentationRuntimeInstances().GetInstances();
1246
45.6k
  if (idx < instances.size())
1247
45.6k
    return instances[idx].get_type_callback;
1248
0
  return nullptr;
1249
45.6k
}
1250
1251
InstrumentationRuntimeCreateInstance
1252
57.1k
PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx) {
1253
57.1k
  return GetInstrumentationRuntimeInstances().GetCallbackAtIndex(idx);
1254
57.1k
}
1255
1256
#pragma mark TypeSystem
1257
1258
struct TypeSystemInstance : public PluginInstance<TypeSystemCreateInstance> {
1259
  TypeSystemInstance(llvm::StringRef name, llvm::StringRef description,
1260
                     CallbackType create_callback,
1261
                     LanguageSet supported_languages_for_types,
1262
                     LanguageSet supported_languages_for_expressions)
1263
      : PluginInstance<TypeSystemCreateInstance>(name, description,
1264
                                                 create_callback),
1265
        supported_languages_for_types(supported_languages_for_types),
1266
        supported_languages_for_expressions(
1267
3.47k
            supported_languages_for_expressions) {}
1268
1269
  LanguageSet supported_languages_for_types;
1270
  LanguageSet supported_languages_for_expressions;
1271
};
1272
1273
typedef PluginInstances<TypeSystemInstance> TypeSystemInstances;
1274
1275
99.3k
static TypeSystemInstances &GetTypeSystemInstances() {
1276
99.3k
  static TypeSystemInstances g_instances;
1277
99.3k
  return g_instances;
1278
99.3k
}
1279
1280
bool PluginManager::RegisterPlugin(
1281
    llvm::StringRef name, llvm::StringRef description,
1282
    TypeSystemCreateInstance create_callback,
1283
    LanguageSet supported_languages_for_types,
1284
3.47k
    LanguageSet supported_languages_for_expressions) {
1285
3.47k
  return GetTypeSystemInstances().RegisterPlugin(
1286
3.47k
      name, description, create_callback, supported_languages_for_types,
1287
3.47k
      supported_languages_for_expressions);
1288
3.47k
}
1289
1290
3.46k
bool PluginManager::UnregisterPlugin(TypeSystemCreateInstance create_callback) {
1291
3.46k
  return GetTypeSystemInstances().UnregisterPlugin(create_callback);
1292
3.46k
}
1293
1294
TypeSystemCreateInstance
1295
5.41k
PluginManager::GetTypeSystemCreateCallbackAtIndex(uint32_t idx) {
1296
5.41k
  return GetTypeSystemInstances().GetCallbackAtIndex(idx);
1297
5.41k
}
1298
1299
84.1k
LanguageSet PluginManager::GetAllTypeSystemSupportedLanguagesForTypes() {
1300
84.1k
  const auto &instances = GetTypeSystemInstances().GetInstances();
1301
84.1k
  LanguageSet all;
1302
168k
  for (unsigned i = 0; i < instances.size(); 
++i84.1k
)
1303
84.1k
    all.bitvector |= instances[i].supported_languages_for_types.bitvector;
1304
84.1k
  return all;
1305
84.1k
}
1306
1307
2.80k
LanguageSet PluginManager::GetAllTypeSystemSupportedLanguagesForExpressions() {
1308
2.80k
  const auto &instances = GetTypeSystemInstances().GetInstances();
1309
2.80k
  LanguageSet all;
1310
5.61k
  for (unsigned i = 0; i < instances.size(); 
++i2.80k
)
1311
2.80k
    all.bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1312
2.80k
  return all;
1313
2.80k
}
1314
1315
#pragma mark REPL
1316
1317
struct REPLInstance : public PluginInstance<REPLCreateInstance> {
1318
  REPLInstance(llvm::StringRef name, llvm::StringRef description,
1319
               CallbackType create_callback, LanguageSet supported_languages)
1320
      : PluginInstance<REPLCreateInstance>(name, description, create_callback),
1321
3.44k
        supported_languages(supported_languages) {}
1322
1323
  LanguageSet supported_languages;
1324
};
1325
1326
typedef PluginInstances<REPLInstance> REPLInstances;
1327
1328
6.88k
static REPLInstances &GetREPLInstances() {
1329
6.88k
  static REPLInstances g_instances;
1330
6.88k
  return g_instances;
1331
6.88k
}
1332
1333
bool PluginManager::RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
1334
                                   REPLCreateInstance create_callback,
1335
3.44k
                                   LanguageSet supported_languages) {
1336
3.44k
  return GetREPLInstances().RegisterPlugin(name, description, create_callback,
1337
3.44k
                                           supported_languages);
1338
3.44k
}
1339
1340
3.43k
bool PluginManager::UnregisterPlugin(REPLCreateInstance create_callback) {
1341
3.43k
  return GetREPLInstances().UnregisterPlugin(create_callback);
1342
3.43k
}
1343
1344
4
REPLCreateInstance PluginManager::GetREPLCreateCallbackAtIndex(uint32_t idx) {
1345
4
  return GetREPLInstances().GetCallbackAtIndex(idx);
1346
4
}
1347
1348
2
LanguageSet PluginManager::GetREPLSupportedLanguagesAtIndex(uint32_t idx) {
1349
2
  const auto &instances = GetREPLInstances().GetInstances();
1350
2
  return idx < instances.size() ? instances[idx].supported_languages
1351
2
                                : 
LanguageSet()0
;
1352
2
}
1353
1354
1
LanguageSet PluginManager::GetREPLAllTypeSystemSupportedLanguages() {
1355
1
  const auto &instances = GetREPLInstances().GetInstances();
1356
1
  LanguageSet all;
1357
2
  for (unsigned i = 0; i < instances.size(); 
++i1
)
1358
1
    all.bitvector |= instances[i].supported_languages.bitvector;
1359
1
  return all;
1360
1
}
1361
1362
#pragma mark PluginManager
1363
1364
5.95k
void PluginManager::DebuggerInitialize(Debugger &debugger) {
1365
5.95k
  GetDynamicLoaderInstances().PerformDebuggerCallback(debugger);
1366
5.95k
  GetJITLoaderInstances().PerformDebuggerCallback(debugger);
1367
5.95k
  GetPlatformInstances().PerformDebuggerCallback(debugger);
1368
5.95k
  GetProcessInstances().PerformDebuggerCallback(debugger);
1369
5.95k
  GetSymbolFileInstances().PerformDebuggerCallback(debugger);
1370
5.95k
  GetOperatingSystemInstances().PerformDebuggerCallback(debugger);
1371
5.95k
  GetStructuredDataPluginInstances().PerformDebuggerCallback(debugger);
1372
5.95k
  GetTracePluginInstances().PerformDebuggerCallback(debugger);
1373
5.95k
}
1374
1375
// This is the preferred new way to register plugin specific settings.  e.g.
1376
// This will put a plugin's settings under e.g.
1377
// "plugin.<plugin_type_name>.<plugin_type_desc>.SETTINGNAME".
1378
static lldb::OptionValuePropertiesSP
1379
GetDebuggerPropertyForPlugins(Debugger &debugger, ConstString plugin_type_name,
1380
65.3k
                              ConstString plugin_type_desc, bool can_create) {
1381
65.3k
  lldb::OptionValuePropertiesSP parent_properties_sp(
1382
65.3k
      debugger.GetValueProperties());
1383
65.3k
  if (parent_properties_sp) {
1384
65.3k
    static ConstString g_property_name("plugin");
1385
1386
65.3k
    OptionValuePropertiesSP plugin_properties_sp =
1387
65.3k
        parent_properties_sp->GetSubProperty(nullptr, g_property_name);
1388
65.3k
    if (!plugin_properties_sp && 
can_create11.8k
) {
1389
5.94k
      plugin_properties_sp =
1390
5.94k
          std::make_shared<OptionValueProperties>(g_property_name);
1391
5.94k
      parent_properties_sp->AppendProperty(
1392
5.94k
          g_property_name, ConstString("Settings specify to plugins."), true,
1393
5.94k
          plugin_properties_sp);
1394
5.94k
    }
1395
1396
65.3k
    if (plugin_properties_sp) {
1397
59.4k
      lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1398
59.4k
          plugin_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1399
59.4k
      if (!plugin_type_properties_sp && 
can_create47.5k
) {
1400
29.7k
        plugin_type_properties_sp =
1401
29.7k
            std::make_shared<OptionValueProperties>(plugin_type_name);
1402
29.7k
        plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1403
29.7k
                                             true, plugin_type_properties_sp);
1404
29.7k
      }
1405
59.4k
      return plugin_type_properties_sp;
1406
59.4k
    }
1407
65.3k
  }
1408
5.94k
  return lldb::OptionValuePropertiesSP();
1409
65.3k
}
1410
1411
// This is deprecated way to register plugin specific settings.  e.g.
1412
// "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" and Platform
1413
// generic settings would be under "platform.SETTINGNAME".
1414
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(
1415
    Debugger &debugger, ConstString plugin_type_name,
1416
24.6k
    ConstString plugin_type_desc, bool can_create) {
1417
24.6k
  static ConstString g_property_name("plugin");
1418
24.6k
  lldb::OptionValuePropertiesSP parent_properties_sp(
1419
24.6k
      debugger.GetValueProperties());
1420
24.6k
  if (parent_properties_sp) {
1421
24.6k
    OptionValuePropertiesSP plugin_properties_sp =
1422
24.6k
        parent_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1423
24.6k
    if (!plugin_properties_sp && 
can_create0
) {
1424
0
      plugin_properties_sp =
1425
0
          std::make_shared<OptionValueProperties>(plugin_type_name);
1426
0
      parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1427
0
                                           true, plugin_properties_sp);
1428
0
    }
1429
1430
24.6k
    if (plugin_properties_sp) {
1431
24.6k
      lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1432
24.6k
          plugin_properties_sp->GetSubProperty(nullptr, g_property_name);
1433
24.6k
      if (!plugin_type_properties_sp && 
can_create6.79k
) {
1434
3.39k
        plugin_type_properties_sp =
1435
3.39k
            std::make_shared<OptionValueProperties>(g_property_name);
1436
3.39k
        plugin_properties_sp->AppendProperty(
1437
3.39k
            g_property_name, ConstString("Settings specific to plugins"), true,
1438
3.39k
            plugin_type_properties_sp);
1439
3.39k
      }
1440
24.6k
      return plugin_type_properties_sp;
1441
24.6k
    }
1442
24.6k
  }
1443
0
  return lldb::OptionValuePropertiesSP();
1444
24.6k
}
1445
1446
namespace {
1447
1448
typedef lldb::OptionValuePropertiesSP
1449
GetDebuggerPropertyForPluginsPtr(Debugger &, ConstString, ConstString,
1450
                                 bool can_create);
1451
}
1452
1453
static lldb::OptionValuePropertiesSP
1454
GetSettingForPlugin(Debugger &debugger, ConstString setting_name,
1455
                    ConstString plugin_type_name,
1456
                    GetDebuggerPropertyForPluginsPtr get_debugger_property =
1457
47.5k
                        GetDebuggerPropertyForPlugins) {
1458
47.5k
  lldb::OptionValuePropertiesSP properties_sp;
1459
47.5k
  lldb::OptionValuePropertiesSP plugin_type_properties_sp(get_debugger_property(
1460
47.5k
      debugger, plugin_type_name,
1461
47.5k
      ConstString(), // not creating to so we don't need the description
1462
47.5k
      false));
1463
47.5k
  if (plugin_type_properties_sp)
1464
20.3k
    properties_sp =
1465
20.3k
        plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1466
47.5k
  return properties_sp;
1467
47.5k
}
1468
1469
static bool
1470
CreateSettingForPlugin(Debugger &debugger, ConstString plugin_type_name,
1471
                       ConstString plugin_type_desc,
1472
                       const lldb::OptionValuePropertiesSP &properties_sp,
1473
                       ConstString description, bool is_global_property,
1474
                       GetDebuggerPropertyForPluginsPtr get_debugger_property =
1475
42.4k
                           GetDebuggerPropertyForPlugins) {
1476
42.4k
  if (properties_sp) {
1477
42.4k
    lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1478
42.4k
        get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1479
42.4k
                              true));
1480
42.4k
    if (plugin_type_properties_sp) {
1481
42.4k
      plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1482
42.4k
                                                description, is_global_property,
1483
42.4k
                                                properties_sp);
1484
42.4k
      return true;
1485
42.4k
    }
1486
42.4k
  }
1487
0
  return false;
1488
42.4k
}
1489
1490
static const char *kDynamicLoaderPluginName("dynamic-loader");
1491
static const char *kPlatformPluginName("platform");
1492
static const char *kProcessPluginName("process");
1493
static const char *kSymbolFilePluginName("symbol-file");
1494
static const char *kJITLoaderPluginName("jit-loader");
1495
static const char *kStructuredDataPluginName("structured-data");
1496
1497
lldb::OptionValuePropertiesSP
1498
PluginManager::GetSettingForDynamicLoaderPlugin(Debugger &debugger,
1499
5.94k
                                                ConstString setting_name) {
1500
5.94k
  return GetSettingForPlugin(debugger, setting_name,
1501
5.94k
                             ConstString(kDynamicLoaderPluginName));
1502
5.94k
}
1503
1504
bool PluginManager::CreateSettingForDynamicLoaderPlugin(
1505
    Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1506
5.94k
    ConstString description, bool is_global_property) {
1507
5.94k
  return CreateSettingForPlugin(
1508
5.94k
      debugger, ConstString(kDynamicLoaderPluginName),
1509
5.94k
      ConstString("Settings for dynamic loader plug-ins"), properties_sp,
1510
5.94k
      description, is_global_property);
1511
5.94k
}
1512
1513
lldb::OptionValuePropertiesSP
1514
PluginManager::GetSettingForPlatformPlugin(Debugger &debugger,
1515
17.8k
                                           ConstString setting_name) {
1516
17.8k
  return GetSettingForPlugin(debugger, setting_name,
1517
17.8k
                             ConstString(kPlatformPluginName),
1518
17.8k
                             GetDebuggerPropertyForPluginsOldStyle);
1519
17.8k
}
1520
1521
bool PluginManager::CreateSettingForPlatformPlugin(
1522
    Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1523
6.79k
    ConstString description, bool is_global_property) {
1524
6.79k
  return CreateSettingForPlugin(debugger, ConstString(kPlatformPluginName),
1525
6.79k
                                ConstString("Settings for platform plug-ins"),
1526
6.79k
                                properties_sp, description, is_global_property,
1527
6.79k
                                GetDebuggerPropertyForPluginsOldStyle);
1528
6.79k
}
1529
1530
lldb::OptionValuePropertiesSP
1531
PluginManager::GetSettingForProcessPlugin(Debugger &debugger,
1532
11.8k
                                          ConstString setting_name) {
1533
11.8k
  return GetSettingForPlugin(debugger, setting_name,
1534
11.8k
                             ConstString(kProcessPluginName));
1535
11.8k
}
1536
1537
bool PluginManager::CreateSettingForProcessPlugin(
1538
    Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1539
11.8k
    ConstString description, bool is_global_property) {
1540
11.8k
  return CreateSettingForPlugin(debugger, ConstString(kProcessPluginName),
1541
11.8k
                                ConstString("Settings for process plug-ins"),
1542
11.8k
                                properties_sp, description, is_global_property);
1543
11.8k
}
1544
1545
lldb::OptionValuePropertiesSP
1546
PluginManager::GetSettingForSymbolFilePlugin(Debugger &debugger,
1547
5.94k
                                             ConstString setting_name) {
1548
5.94k
  return GetSettingForPlugin(debugger, setting_name,
1549
5.94k
                             ConstString(kSymbolFilePluginName));
1550
5.94k
}
1551
1552
bool PluginManager::CreateSettingForSymbolFilePlugin(
1553
    Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1554
5.94k
    ConstString description, bool is_global_property) {
1555
5.94k
  return CreateSettingForPlugin(
1556
5.94k
      debugger, ConstString(kSymbolFilePluginName),
1557
5.94k
      ConstString("Settings for symbol file plug-ins"), properties_sp,
1558
5.94k
      description, is_global_property);
1559
5.94k
}
1560
1561
lldb::OptionValuePropertiesSP
1562
PluginManager::GetSettingForJITLoaderPlugin(Debugger &debugger,
1563
5.94k
                                            ConstString setting_name) {
1564
5.94k
  return GetSettingForPlugin(debugger, setting_name,
1565
5.94k
                             ConstString(kJITLoaderPluginName));
1566
5.94k
}
1567
1568
bool PluginManager::CreateSettingForJITLoaderPlugin(
1569
    Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1570
5.94k
    ConstString description, bool is_global_property) {
1571
5.94k
  return CreateSettingForPlugin(debugger, ConstString(kJITLoaderPluginName),
1572
5.94k
                                ConstString("Settings for JIT loader plug-ins"),
1573
5.94k
                                properties_sp, description, is_global_property);
1574
5.94k
}
1575
1576
static const char *kOperatingSystemPluginName("os");
1577
1578
lldb::OptionValuePropertiesSP
1579
PluginManager::GetSettingForOperatingSystemPlugin(Debugger &debugger,
1580
0
                                                  ConstString setting_name) {
1581
0
  lldb::OptionValuePropertiesSP properties_sp;
1582
0
  lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1583
0
      GetDebuggerPropertyForPlugins(
1584
0
          debugger, ConstString(kOperatingSystemPluginName),
1585
0
          ConstString(), // not creating to so we don't need the description
1586
0
          false));
1587
0
  if (plugin_type_properties_sp)
1588
0
    properties_sp =
1589
0
        plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1590
0
  return properties_sp;
1591
0
}
1592
1593
bool PluginManager::CreateSettingForOperatingSystemPlugin(
1594
    Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1595
0
    ConstString description, bool is_global_property) {
1596
0
  if (properties_sp) {
1597
0
    lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1598
0
        GetDebuggerPropertyForPlugins(
1599
0
            debugger, ConstString(kOperatingSystemPluginName),
1600
0
            ConstString("Settings for operating system plug-ins"), true));
1601
0
    if (plugin_type_properties_sp) {
1602
0
      plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1603
0
                                                description, is_global_property,
1604
0
                                                properties_sp);
1605
0
      return true;
1606
0
    }
1607
0
  }
1608
0
  return false;
1609
0
}
1610
1611
lldb::OptionValuePropertiesSP
1612
PluginManager::GetSettingForStructuredDataPlugin(Debugger &debugger,
1613
0
                                                 ConstString setting_name) {
1614
0
  return GetSettingForPlugin(debugger, setting_name,
1615
0
                             ConstString(kStructuredDataPluginName));
1616
0
}
1617
1618
bool PluginManager::CreateSettingForStructuredDataPlugin(
1619
    Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1620
5.94k
    ConstString description, bool is_global_property) {
1621
5.94k
  return CreateSettingForPlugin(
1622
5.94k
      debugger, ConstString(kStructuredDataPluginName),
1623
5.94k
      ConstString("Settings for structured data plug-ins"), properties_sp,
1624
5.94k
      description, is_global_property);
1625
5.94k
}