LLDB mainline
SystemRuntime.cpp
Go to the documentation of this file.
1//===-- SystemRuntime.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/Target/Process.h"
12#include "lldb/lldb-private.h"
13
14using namespace lldb;
15using namespace lldb_private;
16
18 SystemRuntimeCreateInstance create_callback = nullptr;
19 for (uint32_t idx = 0;
21 idx)) != nullptr;
22 ++idx) {
23 std::unique_ptr<SystemRuntime> instance_up(create_callback(process));
24 if (instance_up)
25 return instance_up.release();
26 }
27 return nullptr;
28}
29
30SystemRuntime::SystemRuntime(Process *process) : Runtime(process), m_types() {}
31
33
35
37
39
40void SystemRuntime::ModulesDidLoad(const ModuleList &module_list) {}
41
42const std::vector<ConstString> &SystemRuntime::GetExtendedBacktraceTypes() {
43 return m_types;
44}
45
47 ConstString type) {
48 return ThreadSP();
49}
A uniqued constant string class.
Definition: ConstString.h:40
A collection class for Module objects.
Definition: ModuleList.h:103
static SystemRuntimeCreateInstance GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx)
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
A plug-in interface definition class for system runtimes.
Definition: SystemRuntime.h:43
virtual void DidAttach()
Called after attaching to a process.
virtual lldb::ThreadSP GetExtendedBacktraceThread(lldb::ThreadSP thread, ConstString type)
Return a Thread which shows the origin of this thread's creation.
virtual void Detach()
Called before detaching from a process.
SystemRuntime(Process *process)
Construct with a process.
void ModulesDidLoad(const ModuleList &module_list) override
Called when modules have been loaded in the process.
virtual const std::vector< ConstString > & GetExtendedBacktraceTypes()
Return a list of thread origin extended backtraces that may be available.
std::vector< ConstString > m_types
virtual void DidLaunch()
Called after launching a process.
~SystemRuntime() override
Destructor.
static SystemRuntime * FindPlugin(Process *process)
Find a system runtime plugin for a given process.
A class that represents a running process on the host machine.
SystemRuntime *(* SystemRuntimeCreateInstance)(Process *process)
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::Thread > ThreadSP
Definition: lldb-forward.h:446