LLDB mainline
PluginManager.cpp File Reference
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Symbol/SaveCoreOptions.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StringList.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <map>
#include <memory>
#include <mutex>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  PluginInfo
struct  PluginInstance< Callback >
class  PluginInstances< Instance >
struct  LanguageRuntimeInstance
struct  ObjectFileInstance
struct  ObjectContainerInstance
struct  RegisterTypeBuilderInstance
struct  ScriptInterpreterInstance
struct  StructuredDataPluginInstance
struct  SymbolLocatorInstance
struct  TraceInstance
struct  TraceExporterInstance
struct  InstrumentationRuntimeInstance
struct  TypeSystemInstance
struct  ScriptedInterfaceInstance
struct  REPLInstance

Typedefs

typedef bool(* PluginInitCallback) ()
typedef void(* PluginTermCallback) ()
typedef std::map< FileSpec, PluginInfoPluginTerminateMap
typedef PluginInstance< ABICreateInstance > ABIInstance
typedef PluginInstances< ABIInstanceABIInstances
typedef PluginInstance< ArchitectureCreateInstance > ArchitectureInstance
typedef PluginInstances< ArchitectureInstanceArchitectureInstances
typedef PluginInstance< DisassemblerCreateInstance > DisassemblerInstance
typedef PluginInstances< DisassemblerInstanceDisassemblerInstances
typedef PluginInstance< DynamicLoaderCreateInstance > DynamicLoaderInstance
typedef PluginInstances< DynamicLoaderInstanceDynamicLoaderInstances
typedef PluginInstance< JITLoaderCreateInstance > JITLoaderInstance
typedef PluginInstances< JITLoaderInstanceJITLoaderInstances
typedef PluginInstance< EmulateInstructionCreateInstance > EmulateInstructionInstance
typedef PluginInstances< EmulateInstructionInstanceEmulateInstructionInstances
typedef PluginInstance< OperatingSystemCreateInstance > OperatingSystemInstance
typedef PluginInstances< OperatingSystemInstanceOperatingSystemInstances
typedef PluginInstance< LanguageCreateInstance > LanguageInstance
typedef PluginInstances< LanguageInstanceLanguageInstances
typedef PluginInstances< LanguageRuntimeInstanceLanguageRuntimeInstances
typedef PluginInstance< SystemRuntimeCreateInstance > SystemRuntimeInstance
typedef PluginInstances< SystemRuntimeInstanceSystemRuntimeInstances
typedef PluginInstances< ObjectFileInstanceObjectFileInstances
typedef PluginInstances< ObjectContainerInstanceObjectContainerInstances
typedef PluginInstance< PlatformCreateInstance > PlatformInstance
typedef PluginInstances< PlatformInstancePlatformInstances
typedef PluginInstance< ProcessCreateInstance > ProcessInstance
typedef PluginInstances< ProcessInstanceProcessInstances
typedef PluginInstance< ProtocolServerCreateInstance > ProtocolServerInstance
typedef PluginInstances< ProtocolServerInstanceProtocolServerInstances
typedef PluginInstances< RegisterTypeBuilderInstanceRegisterTypeBuilderInstances
typedef PluginInstances< ScriptInterpreterInstanceScriptInterpreterInstances
typedef PluginInstances< StructuredDataPluginInstanceStructuredDataPluginInstances
typedef PluginInstance< SymbolFileCreateInstance > SymbolFileInstance
typedef PluginInstances< SymbolFileInstanceSymbolFileInstances
typedef PluginInstance< SymbolVendorCreateInstance > SymbolVendorInstance
typedef PluginInstances< SymbolVendorInstanceSymbolVendorInstances
typedef PluginInstances< SymbolLocatorInstanceSymbolLocatorInstances
typedef PluginInstances< TraceInstanceTraceInstances
typedef PluginInstances< TraceExporterInstanceTraceExporterInstances
typedef PluginInstance< UnwindAssemblyCreateInstance > UnwindAssemblyInstance
typedef PluginInstances< UnwindAssemblyInstanceUnwindAssemblyInstances
typedef PluginInstance< MemoryHistoryCreateInstance > MemoryHistoryInstance
typedef PluginInstances< MemoryHistoryInstanceMemoryHistoryInstances
typedef PluginInstances< InstrumentationRuntimeInstanceInstrumentationRuntimeInstances
typedef PluginInstances< TypeSystemInstanceTypeSystemInstances
typedef PluginInstances< ScriptedInterfaceInstanceScriptedInterfaceInstances
typedef PluginInstances< REPLInstanceREPLInstances

Functions

static std::recursive_mutex & GetPluginMapMutex ()
static PluginTerminateMapGetPluginMap ()
static bool PluginIsLoaded (const FileSpec &plugin_file_spec)
static void SetPluginInfo (const FileSpec &plugin_file_spec, const PluginInfo &plugin_info)
template<typename FPtrTy>
static FPtrTy CastToFPtr (void *VPtr)
static FileSystem::EnumerateDirectoryResult LoadPluginCallback (void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
static ABIInstancesGetABIInstances ()
static ArchitectureInstancesGetArchitectureInstances ()
static DisassemblerInstancesGetDisassemblerInstances ()
static DynamicLoaderInstancesGetDynamicLoaderInstances ()
static JITLoaderInstancesGetJITLoaderInstances ()
static EmulateInstructionInstancesGetEmulateInstructionInstances ()
static OperatingSystemInstancesGetOperatingSystemInstances ()
static LanguageInstancesGetLanguageInstances ()
static LanguageRuntimeInstancesGetLanguageRuntimeInstances ()
static SystemRuntimeInstancesGetSystemRuntimeInstances ()
static ObjectFileInstancesGetObjectFileInstances ()
static ObjectContainerInstancesGetObjectContainerInstances ()
static PlatformInstancesGetPlatformInstances ()
static ProcessInstancesGetProcessInstances ()
static ProtocolServerInstancesGetProtocolServerInstances ()
static RegisterTypeBuilderInstancesGetRegisterTypeBuilderInstances ()
static ScriptInterpreterInstancesGetScriptInterpreterInstances ()
static StructuredDataPluginInstancesGetStructuredDataPluginInstances ()
static SymbolFileInstancesGetSymbolFileInstances ()
static SymbolVendorInstancesGetSymbolVendorInstances ()
static SymbolLocatorInstancesGetSymbolLocatorInstances ()
static TraceInstancesGetTracePluginInstances ()
static TraceExporterInstancesGetTraceExporterInstances ()
static UnwindAssemblyInstancesGetUnwindAssemblyInstances ()
static MemoryHistoryInstancesGetMemoryHistoryInstances ()
static InstrumentationRuntimeInstancesGetInstrumentationRuntimeInstances ()
static TypeSystemInstancesGetTypeSystemInstances ()
static ScriptedInterfaceInstancesGetScriptedInterfaceInstances ()
static REPLInstancesGetREPLInstances ()
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins (Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle (Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
static lldb::OptionValuePropertiesSP GetSettingForPlugin (Debugger &debugger, llvm::StringRef setting_name, llvm::StringRef plugin_type_name, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
static bool CreateSettingForPlugin (Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
static constexpr llvm::StringLiteral kDynamicLoaderPluginName ("dynamic-loader")
static constexpr llvm::StringLiteral kPlatformPluginName ("platform")
static constexpr llvm::StringLiteral kProcessPluginName ("process")
static constexpr llvm::StringLiteral kTracePluginName ("trace")
static constexpr llvm::StringLiteral kObjectFilePluginName ("object-file")
static constexpr llvm::StringLiteral kSymbolFilePluginName ("symbol-file")
static constexpr llvm::StringLiteral kSymbolLocatorPluginName ("symbol-locator")
static constexpr llvm::StringLiteral kJITLoaderPluginName ("jit-loader")
static constexpr llvm::StringLiteral kStructuredDataPluginName ("structured-data")
static constexpr llvm::StringLiteral kCPlusPlusLanguagePlugin ("cplusplus")
static const char * kOperatingSystemPluginName ("os")

Typedef Documentation

◆ ABIInstance

typedef PluginInstance<ABICreateInstance> ABIInstance

Definition at line 548 of file PluginManager.cpp.

◆ ABIInstances

Definition at line 549 of file PluginManager.cpp.

◆ ArchitectureInstance

typedef PluginInstance<ArchitectureCreateInstance> ArchitectureInstance

Definition at line 572 of file PluginManager.cpp.

◆ ArchitectureInstances

◆ DisassemblerInstance

typedef PluginInstance<DisassemblerCreateInstance> DisassemblerInstance

Definition at line 603 of file PluginManager.cpp.

◆ DisassemblerInstances

◆ DynamicLoaderInstance

typedef PluginInstance<DynamicLoaderCreateInstance> DynamicLoaderInstance

Definition at line 636 of file PluginManager.cpp.

◆ DynamicLoaderInstances

◆ EmulateInstructionInstance

typedef PluginInstance<EmulateInstructionCreateInstance> EmulateInstructionInstance

Definition at line 698 of file PluginManager.cpp.

◆ EmulateInstructionInstances

◆ InstrumentationRuntimeInstances

◆ JITLoaderInstance

typedef PluginInstance<JITLoaderCreateInstance> JITLoaderInstance

Definition at line 670 of file PluginManager.cpp.

◆ JITLoaderInstances

◆ LanguageInstance

typedef PluginInstance<LanguageCreateInstance> LanguageInstance

Definition at line 765 of file PluginManager.cpp.

◆ LanguageInstances

◆ LanguageRuntimeInstances

◆ MemoryHistoryInstance

typedef PluginInstance<MemoryHistoryCreateInstance> MemoryHistoryInstance

Definition at line 1690 of file PluginManager.cpp.

◆ MemoryHistoryInstances

◆ ObjectContainerInstances

◆ ObjectFileInstances

◆ OperatingSystemInstance

typedef PluginInstance<OperatingSystemCreateInstance> OperatingSystemInstance

Definition at line 731 of file PluginManager.cpp.

◆ OperatingSystemInstances

◆ PlatformInstance

typedef PluginInstance<PlatformCreateInstance> PlatformInstance

Definition at line 1080 of file PluginManager.cpp.

◆ PlatformInstances

◆ PluginInitCallback

typedef bool(* PluginInitCallback) ()

Definition at line 39 of file PluginManager.cpp.

◆ PluginTermCallback

typedef void(* PluginTermCallback) ()

Definition at line 40 of file PluginManager.cpp.

◆ PluginTerminateMap

Definition at line 50 of file PluginManager.cpp.

◆ ProcessInstance

typedef PluginInstance<ProcessCreateInstance> ProcessInstance

Definition at line 1129 of file PluginManager.cpp.

◆ ProcessInstances

◆ ProtocolServerInstance

typedef PluginInstance<ProtocolServerCreateInstance> ProtocolServerInstance

Definition at line 1177 of file PluginManager.cpp.

◆ ProtocolServerInstances

◆ RegisterTypeBuilderInstances

◆ REPLInstances

Definition at line 1897 of file PluginManager.cpp.

◆ ScriptedInterfaceInstances

◆ ScriptInterpreterInstances

◆ StructuredDataPluginInstances

◆ SymbolFileInstance

typedef PluginInstance<SymbolFileCreateInstance> SymbolFileInstance

Definition at line 1361 of file PluginManager.cpp.

◆ SymbolFileInstances

◆ SymbolLocatorInstances

◆ SymbolVendorInstance

typedef PluginInstance<SymbolVendorCreateInstance> SymbolVendorInstance

Definition at line 1388 of file PluginManager.cpp.

◆ SymbolVendorInstances

◆ SystemRuntimeInstance

typedef PluginInstance<SystemRuntimeCreateInstance> SystemRuntimeInstance

Definition at line 852 of file PluginManager.cpp.

◆ SystemRuntimeInstances

◆ TraceExporterInstances

◆ TraceInstances

Definition at line 1558 of file PluginManager.cpp.

◆ TypeSystemInstances

◆ UnwindAssemblyInstance

typedef PluginInstance<UnwindAssemblyCreateInstance> UnwindAssemblyInstance

Definition at line 1663 of file PluginManager.cpp.

◆ UnwindAssemblyInstances

Function Documentation

◆ CastToFPtr()

template<typename FPtrTy>
FPtrTy CastToFPtr ( void * VPtr)
static

Definition at line 76 of file PluginManager.cpp.

Referenced by LoadPluginCallback().

◆ CreateSettingForPlugin()

◆ GetABIInstances()

◆ GetArchitectureInstances()

◆ GetDebuggerPropertyForPlugins()

lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins ( Debugger & debugger,
llvm::StringRef plugin_type_name,
llvm::StringRef plugin_type_desc,
bool can_create )
static

◆ GetDebuggerPropertyForPluginsOldStyle()

lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle ( Debugger & debugger,
llvm::StringRef plugin_type_name,
llvm::StringRef plugin_type_desc,
bool can_create )
static

◆ GetDisassemblerInstances()

◆ GetDynamicLoaderInstances()

◆ GetEmulateInstructionInstances()

◆ GetInstrumentationRuntimeInstances()

◆ GetJITLoaderInstances()

◆ GetLanguageInstances()

◆ GetLanguageRuntimeInstances()

◆ GetMemoryHistoryInstances()

◆ GetObjectContainerInstances()

◆ GetObjectFileInstances()

◆ GetOperatingSystemInstances()

◆ GetPlatformInstances()

◆ GetPluginMap()

PluginTerminateMap & GetPluginMap ( )
static

◆ GetPluginMapMutex()

std::recursive_mutex & GetPluginMapMutex ( )
static

◆ GetProcessInstances()

◆ GetProtocolServerInstances()

◆ GetRegisterTypeBuilderInstances()

◆ GetREPLInstances()

◆ GetScriptedInterfaceInstances()

◆ GetScriptInterpreterInstances()

◆ GetSettingForPlugin()

◆ GetStructuredDataPluginInstances()

◆ GetSymbolFileInstances()

◆ GetSymbolLocatorInstances()

◆ GetSymbolVendorInstances()

◆ GetSystemRuntimeInstances()

◆ GetTraceExporterInstances()

◆ GetTracePluginInstances()

◆ GetTypeSystemInstances()

◆ GetUnwindAssemblyInstances()

◆ kCPlusPlusLanguagePlugin()

constexpr llvm::StringLiteral kCPlusPlusLanguagePlugin ( "cplusplus" )
staticconstexpr

◆ kDynamicLoaderPluginName()

constexpr llvm::StringLiteral kDynamicLoaderPluginName ( "dynamic-loader" )
staticconstexpr

◆ kJITLoaderPluginName()

constexpr llvm::StringLiteral kJITLoaderPluginName ( "jit-loader" )
staticconstexpr

◆ kObjectFilePluginName()

constexpr llvm::StringLiteral kObjectFilePluginName ( "object-file" )
staticconstexpr

◆ kOperatingSystemPluginName()

◆ kPlatformPluginName()

constexpr llvm::StringLiteral kPlatformPluginName ( "platform" )
staticconstexpr

◆ kProcessPluginName()

constexpr llvm::StringLiteral kProcessPluginName ( "process" )
staticconstexpr

◆ kStructuredDataPluginName()

constexpr llvm::StringLiteral kStructuredDataPluginName ( "structured-data" )
staticconstexpr

◆ kSymbolFilePluginName()

constexpr llvm::StringLiteral kSymbolFilePluginName ( "symbol-file" )
staticconstexpr

◆ kSymbolLocatorPluginName()

constexpr llvm::StringLiteral kSymbolLocatorPluginName ( "symbol-locator" )
staticconstexpr

◆ kTracePluginName()

constexpr llvm::StringLiteral kTracePluginName ( "trace" )
staticconstexpr

◆ LoadPluginCallback()

◆ PluginIsLoaded()

bool PluginIsLoaded ( const FileSpec & plugin_file_spec)
static

Definition at line 62 of file PluginManager.cpp.

References GetPluginMap(), and GetPluginMapMutex().

Referenced by LoadPluginCallback().

◆ SetPluginInfo()

void SetPluginInfo ( const FileSpec & plugin_file_spec,
const PluginInfo & plugin_info )
static

Definition at line 68 of file PluginManager.cpp.

References GetPluginMap(), and GetPluginMapMutex().

Referenced by LoadPluginCallback().