2014-03-05 18:12:43 +08:00
|
|
|
//===-- JITLoader.cpp -------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-02-18 08:10:17 +08:00
|
|
|
// C Includes
|
|
|
|
// C++ Includes
|
|
|
|
// Other libraries and framework includes
|
|
|
|
// Project includes
|
2014-03-05 18:12:43 +08:00
|
|
|
#include "lldb/Target/JITLoader.h"
|
2016-09-07 04:57:50 +08:00
|
|
|
#include "lldb/Core/PluginManager.h"
|
2014-03-05 18:12:43 +08:00
|
|
|
#include "lldb/Target/JITLoaderList.h"
|
|
|
|
#include "lldb/Target/Process.h"
|
2016-09-07 04:57:50 +08:00
|
|
|
#include "lldb/lldb-private.h"
|
2014-03-05 18:12:43 +08:00
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
void JITLoader::LoadPlugins(Process *process, JITLoaderList &list) {
|
|
|
|
JITLoaderCreateInstance create_callback = nullptr;
|
|
|
|
for (uint32_t idx = 0;
|
|
|
|
(create_callback =
|
|
|
|
PluginManager::GetJITLoaderCreateCallbackAtIndex(idx)) != nullptr;
|
|
|
|
++idx) {
|
|
|
|
JITLoaderSP instance_sp(create_callback(process, false));
|
|
|
|
if (instance_sp)
|
|
|
|
list.Append(std::move(instance_sp));
|
|
|
|
}
|
2014-03-05 18:12:43 +08:00
|
|
|
}
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
JITLoader::JITLoader(Process *process) : m_process(process) {}
|
2014-03-05 18:12:43 +08:00
|
|
|
|
2016-02-18 08:10:17 +08:00
|
|
|
JITLoader::~JITLoader() = default;
|