LLDB mainline
OperatingSystem.h
Go to the documentation of this file.
1//===-- OperatingSystem.h ----------------------------------------------*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLDB_TARGET_OPERATINGSYSTEM_H
11#define LLDB_TARGET_OPERATINGSYSTEM_H
12
14#include "lldb/lldb-private.h"
15
16namespace lldb_private {
17
18/// \class OperatingSystem OperatingSystem.h "lldb/Target/OperatingSystem.h"
19/// A plug-in interface definition class for halted OS helpers.
20///
21/// Halted OS plug-ins can be used by any process to locate and create
22/// OS objects, like threads, during the lifetime of a debug session.
23/// This is commonly used when attaching to an operating system that is
24/// halted, such as when debugging over JTAG or connecting to low level kernel
25/// debug services.
26
28public:
29 /// Find a halted OS plugin for a given process.
30 ///
31 /// Scans the installed OperatingSystem plug-ins and tries to find an
32 /// instance that matches the current target triple and executable.
33 ///
34 /// \param[in] process
35 /// The process for which to try and locate a halted OS
36 /// plug-in instance.
37 ///
38 /// \param[in] plugin_name
39 /// An optional name of a specific halted OS plug-in that
40 /// should be used. If NULL, pick the best plug-in.
41 static OperatingSystem *FindPlugin(Process *process, const char *plugin_name);
42
43 OperatingSystem(Process *process);
44
45 // Plug-in Methods
46 virtual bool UpdateThreadList(ThreadList &old_thread_list,
47 ThreadList &real_thread_list,
48 ThreadList &new_thread_list) = 0;
49
50 virtual void ThreadWasSelected(Thread *thread) = 0;
51
54 lldb::addr_t reg_data_addr) = 0;
55
57
59 return lldb::ThreadSP();
60 }
61
62 virtual bool IsOperatingSystemPluginThread(const lldb::ThreadSP &thread_sp);
63
64protected:
65 // Member variables.
67 *m_process; ///< The process that this dynamic loader plug-in is tracking.
68};
69
70} // namespace lldb_private
71
72#endif // LLDB_TARGET_OPERATINGSYSTEM_H
A plug-in interface definition class for halted OS helpers.
virtual lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context)
static OperatingSystem * FindPlugin(Process *process, const char *plugin_name)
Find a halted OS plugin for a given process.
Process * m_process
The process that this dynamic loader plug-in is tracking.
virtual lldb::RegisterContextSP CreateRegisterContextForThread(Thread *thread, lldb::addr_t reg_data_addr)=0
virtual bool UpdateThreadList(ThreadList &old_thread_list, ThreadList &real_thread_list, ThreadList &new_thread_list)=0
virtual bool IsOperatingSystemPluginThread(const lldb::ThreadSP &thread_sp)
virtual lldb::StopInfoSP CreateThreadStopReason(Thread *thread)=0
virtual void ThreadWasSelected(Thread *thread)=0
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::Thread > ThreadSP
Definition: lldb-forward.h:438
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
Definition: lldb-forward.h:419
uint64_t addr_t
Definition: lldb-types.h:79
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
Definition: lldb-forward.h:386
uint64_t tid_t
Definition: lldb-types.h:82