diff options
Diffstat (limited to 'include/lldb/Initialization')
| -rw-r--r-- | include/lldb/Initialization/SystemInitializer.h | 26 | ||||
| -rw-r--r-- | include/lldb/Initialization/SystemInitializerCommon.h | 38 | ||||
| -rw-r--r-- | include/lldb/Initialization/SystemLifetimeManager.h | 42 |
3 files changed, 106 insertions, 0 deletions
diff --git a/include/lldb/Initialization/SystemInitializer.h b/include/lldb/Initialization/SystemInitializer.h new file mode 100644 index 000000000000..c7f98f24ae48 --- /dev/null +++ b/include/lldb/Initialization/SystemInitializer.h @@ -0,0 +1,26 @@ +//===-- SystemInitializer.h -------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_INITIALIZATION_SYSTEM_INITIALIZER_H +#define LLDB_INITIALIZATION_SYSTEM_INITIALIZER_H + +namespace lldb_private +{ +class SystemInitializer +{ + public: + SystemInitializer(); + virtual ~SystemInitializer(); + + virtual void Initialize() = 0; + virtual void Terminate() = 0; +}; +} + +#endif diff --git a/include/lldb/Initialization/SystemInitializerCommon.h b/include/lldb/Initialization/SystemInitializerCommon.h new file mode 100644 index 000000000000..af66c93a5e48 --- /dev/null +++ b/include/lldb/Initialization/SystemInitializerCommon.h @@ -0,0 +1,38 @@ +//===-- SystemInitializerCommon.h -------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_INITIALIZATION_SYSTEM_INITIALIZER_COMMON_H +#define LLDB_INITIALIZATION_SYSTEM_INITIALIZER_COMMON_H + +#include "SystemInitializer.h" + +namespace lldb_private +{ +//------------------------------------------------------------------ +/// Initializes common lldb functionality. +/// +/// This class is responsible for initializing a subset of lldb +/// useful to both debug servers and debug clients. Debug servers +/// do not use all of LLDB and desire small binary sizes, so this +/// functionality is separate. This class is used by constructing +/// an instance of SystemLifetimeManager with this class passed to +/// the constructor. +//------------------------------------------------------------------ +class SystemInitializerCommon : public SystemInitializer +{ + public: + SystemInitializerCommon(); + virtual ~SystemInitializerCommon(); + + void Initialize() override; + void Terminate() override; +}; +} + +#endif diff --git a/include/lldb/Initialization/SystemLifetimeManager.h b/include/lldb/Initialization/SystemLifetimeManager.h new file mode 100644 index 000000000000..843ec2820677 --- /dev/null +++ b/include/lldb/Initialization/SystemLifetimeManager.h @@ -0,0 +1,42 @@ +//===-- SystemLifetimeManager.h -------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_INITIALIZATION_SYSTEM_LIFETIME_MANAGER_H +#define LLDB_INITIALIZATION_SYSTEM_LIFETIME_MANAGER_H + +#include "lldb/lldb-private-types.h" +#include "lldb/Host/Mutex.h" + +#include <memory> + +namespace lldb_private +{ +class SystemInitializer; + +class SystemLifetimeManager +{ + public: + SystemLifetimeManager(); + ~SystemLifetimeManager(); + + void Initialize(std::unique_ptr<SystemInitializer> initializer, LoadPluginCallbackType plugin_callback); + void Terminate(); + + private: + Mutex m_mutex; + std::unique_ptr<SystemInitializer> m_initializer; + bool m_initialized; + + // Noncopyable. + SystemLifetimeManager(const SystemLifetimeManager &other) = delete; + SystemLifetimeManager &operator=(const SystemLifetimeManager &other) = delete; +}; +} + +#endif |
