1 //===-- OperatingSystem.h ----------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_OperatingSystem_h_
11 #define liblldb_OperatingSystem_h_
15 // Other libraries and framework includes
17 #include "lldb/lldb-private.h"
18 #include "lldb/Core/PluginInterface.h"
20 namespace lldb_private {
22 //----------------------------------------------------------------------
23 /// @class OperatingSystem OperatingSystem.h "lldb/Target/OperatingSystem.h"
24 /// @brief A plug-in interface definition class for halted OS helpers.
26 /// Halted OS plug-ins can be used by any process to locate and create
27 /// OS objects, like threads, during the lifetime of a debug session.
28 /// This is commonly used when attaching to an operating system that is
29 /// halted, such as when debugging over JTAG or connecting to low level
30 /// kernel debug services.
31 //----------------------------------------------------------------------
33 class OperatingSystem :
34 public PluginInterface
38 //------------------------------------------------------------------
39 /// Find a halted OS plugin for a given process.
41 /// Scans the installed OperatingSystem plug-ins and tries to find
42 /// an instance that matches the current target triple and
45 /// @param[in] process
46 /// The process for which to try and locate a halted OS
49 /// @param[in] plugin_name
50 /// An optional name of a specific halted OS plug-in that
51 /// should be used. If NULL, pick the best plug-in.
52 //------------------------------------------------------------------
53 static OperatingSystem*
54 FindPlugin (Process *process, const char *plugin_name);
56 //------------------------------------------------------------------
58 //------------------------------------------------------------------
59 OperatingSystem (Process *process);
64 //------------------------------------------------------------------
66 //------------------------------------------------------------------
68 UpdateThreadList (ThreadList &old_thread_list,
69 ThreadList &real_thread_list,
70 ThreadList &new_thread_list) = 0;
73 ThreadWasSelected (Thread *thread) = 0;
75 virtual lldb::RegisterContextSP
76 CreateRegisterContextForThread (Thread *thread, lldb::addr_t reg_data_addr) = 0;
78 virtual lldb::StopInfoSP
79 CreateThreadStopReason (Thread *thread) = 0;
81 virtual lldb::ThreadSP
82 CreateThread (lldb::tid_t tid, lldb::addr_t context)
84 return lldb::ThreadSP();
88 IsOperatingSystemPluginThread (const lldb::ThreadSP &thread_sp);
91 //------------------------------------------------------------------
93 //------------------------------------------------------------------
94 Process* m_process; ///< The process that this dynamic loader plug-in is tracking.
96 DISALLOW_COPY_AND_ASSIGN (OperatingSystem);
99 } // namespace lldb_private
101 #endif // #ifndef liblldb_OperatingSystem_h_