LLDB mainline
JITLoaderList.cpp
Go to the documentation of this file.
1//===-- JITLoaderList.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
11#include "lldb/lldb-private.h"
12
13using namespace lldb;
14using namespace lldb_private;
15
16JITLoaderList::JITLoaderList() : m_jit_loaders_vec(), m_jit_loaders_mutex() {}
17
19
20void JITLoaderList::Append(const JITLoaderSP &jit_loader_sp) {
21 std::lock_guard<std::recursive_mutex> guard(m_jit_loaders_mutex);
22 m_jit_loaders_vec.push_back(jit_loader_sp);
23}
24
25void JITLoaderList::Remove(const JITLoaderSP &jit_loader_sp) {
26 std::lock_guard<std::recursive_mutex> guard(m_jit_loaders_mutex);
27 llvm::erase(m_jit_loaders_vec, jit_loader_sp);
28}
29
30size_t JITLoaderList::GetSize() const { return m_jit_loaders_vec.size(); }
31
33 std::lock_guard<std::recursive_mutex> guard(m_jit_loaders_mutex);
34 return m_jit_loaders_vec[idx];
35}
36
38 std::lock_guard<std::recursive_mutex> guard(m_jit_loaders_mutex);
39 for (auto const &jit_loader : m_jit_loaders_vec)
40 jit_loader->DidLaunch();
41}
42
44 std::lock_guard<std::recursive_mutex> guard(m_jit_loaders_mutex);
45 for (auto const &jit_loader : m_jit_loaders_vec)
46 jit_loader->DidAttach();
47}
48
50 std::lock_guard<std::recursive_mutex> guard(m_jit_loaders_mutex);
51 for (auto const &jit_loader : m_jit_loaders_vec)
52 jit_loader->ModulesDidLoad(module_list);
53}
std::vector< lldb::JITLoaderSP > m_jit_loaders_vec
Definition: JITLoaderList.h:42
void ModulesDidLoad(ModuleList &module_list)
void Remove(const lldb::JITLoaderSP &jit_loader_sp)
void Append(const lldb::JITLoaderSP &jit_loader_sp)
std::recursive_mutex m_jit_loaders_mutex
Definition: JITLoaderList.h:43
lldb::JITLoaderSP GetLoaderAtIndex(size_t idx)
A collection class for Module objects.
Definition: ModuleList.h:103
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::JITLoader > JITLoaderSP
Definition: lldb-forward.h:364