LLDB mainline
Classes | Typedefs | Functions
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/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 std::vector< 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 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 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 const char * kOperatingSystemPluginName ("os")
 

Typedef Documentation

◆ ABIInstance

typedef PluginInstance<ABICreateInstance> ABIInstance

Definition at line 279 of file PluginManager.cpp.

◆ ABIInstances

Definition at line 280 of file PluginManager.cpp.

◆ ArchitectureInstance

typedef PluginInstance<ArchitectureCreateInstance> ArchitectureInstance

Definition at line 303 of file PluginManager.cpp.

◆ ArchitectureInstances

Definition at line 304 of file PluginManager.cpp.

◆ DisassemblerInstance

typedef PluginInstance<DisassemblerCreateInstance> DisassemblerInstance

Definition at line 341 of file PluginManager.cpp.

◆ DisassemblerInstances

Definition at line 342 of file PluginManager.cpp.

◆ DynamicLoaderInstance

typedef PluginInstance<DynamicLoaderCreateInstance> DynamicLoaderInstance

Definition at line 374 of file PluginManager.cpp.

◆ DynamicLoaderInstances

Definition at line 375 of file PluginManager.cpp.

◆ EmulateInstructionInstance

typedef PluginInstance<EmulateInstructionCreateInstance> EmulateInstructionInstance

Definition at line 436 of file PluginManager.cpp.

◆ EmulateInstructionInstances

Definition at line 437 of file PluginManager.cpp.

◆ InstrumentationRuntimeInstances

Definition at line 1420 of file PluginManager.cpp.

◆ JITLoaderInstance

typedef PluginInstance<JITLoaderCreateInstance> JITLoaderInstance

Definition at line 408 of file PluginManager.cpp.

◆ JITLoaderInstances

Definition at line 409 of file PluginManager.cpp.

◆ LanguageInstance

typedef PluginInstance<LanguageCreateInstance> LanguageInstance

Definition at line 503 of file PluginManager.cpp.

◆ LanguageInstances

Definition at line 504 of file PluginManager.cpp.

◆ LanguageRuntimeInstances

Definition at line 546 of file PluginManager.cpp.

◆ MemoryHistoryInstance

typedef PluginInstance<MemoryHistoryCreateInstance> MemoryHistoryInstance

Definition at line 1379 of file PluginManager.cpp.

◆ MemoryHistoryInstances

Definition at line 1380 of file PluginManager.cpp.

◆ ObjectContainerInstances

Definition at line 766 of file PluginManager.cpp.

◆ ObjectFileInstances

Definition at line 636 of file PluginManager.cpp.

◆ OperatingSystemInstance

typedef PluginInstance<OperatingSystemCreateInstance> OperatingSystemInstance

Definition at line 469 of file PluginManager.cpp.

◆ OperatingSystemInstances

Definition at line 470 of file PluginManager.cpp.

◆ PlatformInstance

typedef PluginInstance<PlatformCreateInstance> PlatformInstance

Definition at line 812 of file PluginManager.cpp.

◆ PlatformInstances

Definition at line 813 of file PluginManager.cpp.

◆ PluginInitCallback

typedef bool(* PluginInitCallback) ()

Definition at line 38 of file PluginManager.cpp.

◆ PluginTermCallback

typedef void(* PluginTermCallback) ()

Definition at line 39 of file PluginManager.cpp.

◆ PluginTerminateMap

Definition at line 49 of file PluginManager.cpp.

◆ ProcessInstance

typedef PluginInstance<ProcessCreateInstance> ProcessInstance

Definition at line 861 of file PluginManager.cpp.

◆ ProcessInstances

Definition at line 862 of file PluginManager.cpp.

◆ RegisterTypeBuilderInstances

Definition at line 918 of file PluginManager.cpp.

◆ REPLInstances

Definition at line 1587 of file PluginManager.cpp.

◆ ScriptedInterfaceInstances

Definition at line 1528 of file PluginManager.cpp.

◆ ScriptInterpreterInstances

Definition at line 960 of file PluginManager.cpp.

◆ StructuredDataPluginInstances

Definition at line 1020 of file PluginManager.cpp.

◆ SymbolFileInstance

typedef PluginInstance<SymbolFileCreateInstance> SymbolFileInstance

Definition at line 1062 of file PluginManager.cpp.

◆ SymbolFileInstances

Definition at line 1063 of file PluginManager.cpp.

◆ SymbolLocatorInstances

Definition at line 1138 of file PluginManager.cpp.

◆ SymbolVendorInstance

typedef PluginInstance<SymbolVendorCreateInstance> SymbolVendorInstance

Definition at line 1089 of file PluginManager.cpp.

◆ SymbolVendorInstances

Definition at line 1090 of file PluginManager.cpp.

◆ SystemRuntimeInstance

typedef PluginInstance<SystemRuntimeCreateInstance> SystemRuntimeInstance

Definition at line 591 of file PluginManager.cpp.

◆ SystemRuntimeInstances

Definition at line 592 of file PluginManager.cpp.

◆ TraceExporterInstances

Definition at line 1312 of file PluginManager.cpp.

◆ TraceInstances

Definition at line 1246 of file PluginManager.cpp.

◆ TypeSystemInstances

Definition at line 1470 of file PluginManager.cpp.

◆ UnwindAssemblyInstance

typedef PluginInstance<UnwindAssemblyCreateInstance> UnwindAssemblyInstance

Definition at line 1352 of file PluginManager.cpp.

◆ UnwindAssemblyInstances

Definition at line 1353 of file PluginManager.cpp.

Function Documentation

◆ CastToFPtr()

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

Definition at line 75 of file PluginManager.cpp.

◆ CreateSettingForPlugin()

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

◆ GetABIInstances()

static ABIInstances & GetABIInstances ( )
static

◆ GetArchitectureInstances()

static ArchitectureInstances & GetArchitectureInstances ( )
static

◆ GetDebuggerPropertyForPlugins()

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

◆ GetDebuggerPropertyForPluginsOldStyle()

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

◆ GetDisassemblerInstances()

static DisassemblerInstances & GetDisassemblerInstances ( )
static

◆ GetDynamicLoaderInstances()

static DynamicLoaderInstances & GetDynamicLoaderInstances ( )
static

◆ GetEmulateInstructionInstances()

static EmulateInstructionInstances & GetEmulateInstructionInstances ( )
static

◆ GetInstrumentationRuntimeInstances()

static InstrumentationRuntimeInstances & GetInstrumentationRuntimeInstances ( )
static

◆ GetJITLoaderInstances()

static JITLoaderInstances & GetJITLoaderInstances ( )
static

◆ GetLanguageInstances()

static LanguageInstances & GetLanguageInstances ( )
static

◆ GetLanguageRuntimeInstances()

static LanguageRuntimeInstances & GetLanguageRuntimeInstances ( )
static

◆ GetMemoryHistoryInstances()

static MemoryHistoryInstances & GetMemoryHistoryInstances ( )
static

◆ GetObjectContainerInstances()

static ObjectContainerInstances & GetObjectContainerInstances ( )
static

◆ GetObjectFileInstances()

static ObjectFileInstances & GetObjectFileInstances ( )
static

◆ GetOperatingSystemInstances()

static OperatingSystemInstances & GetOperatingSystemInstances ( )
static

◆ GetPlatformInstances()

static PlatformInstances & GetPlatformInstances ( )
static

◆ GetPluginMap()

static PluginTerminateMap & GetPluginMap ( )
static

◆ GetPluginMapMutex()

static std::recursive_mutex & GetPluginMapMutex ( )
static

◆ GetProcessInstances()

static ProcessInstances & GetProcessInstances ( )
static

◆ GetRegisterTypeBuilderInstances()

static RegisterTypeBuilderInstances & GetRegisterTypeBuilderInstances ( )
static

◆ GetREPLInstances()

static REPLInstances & GetREPLInstances ( )
static

◆ GetScriptedInterfaceInstances()

static ScriptedInterfaceInstances & GetScriptedInterfaceInstances ( )
static

◆ GetScriptInterpreterInstances()

static ScriptInterpreterInstances & GetScriptInterpreterInstances ( )
static

◆ GetSettingForPlugin()

static lldb::OptionValuePropertiesSP GetSettingForPlugin ( Debugger debugger,
llvm::StringRef  setting_name,
llvm::StringRef  plugin_type_name,
GetDebuggerPropertyForPluginsPtr  get_debugger_property = GetDebuggerPropertyForPlugins 
)
static

◆ GetStructuredDataPluginInstances()

static StructuredDataPluginInstances & GetStructuredDataPluginInstances ( )
static

◆ GetSymbolFileInstances()

static SymbolFileInstances & GetSymbolFileInstances ( )
static

◆ GetSymbolLocatorInstances()

static SymbolLocatorInstances & GetSymbolLocatorInstances ( )
static

◆ GetSymbolVendorInstances()

static SymbolVendorInstances & GetSymbolVendorInstances ( )
static

◆ GetSystemRuntimeInstances()

static SystemRuntimeInstances & GetSystemRuntimeInstances ( )
static

◆ GetTraceExporterInstances()

static TraceExporterInstances & GetTraceExporterInstances ( )
static

◆ GetTracePluginInstances()

static TraceInstances & GetTracePluginInstances ( )
static

◆ GetTypeSystemInstances()

static TypeSystemInstances & GetTypeSystemInstances ( )
static

◆ GetUnwindAssemblyInstances()

static UnwindAssemblyInstances & GetUnwindAssemblyInstances ( )
static

◆ kDynamicLoaderPluginName()

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

◆ kJITLoaderPluginName()

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

◆ kObjectFilePluginName()

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

◆ kOperatingSystemPluginName()

static const char * kOperatingSystemPluginName ( "os"  )
static

◆ kPlatformPluginName()

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

◆ kProcessPluginName()

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

◆ kStructuredDataPluginName()

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

◆ kSymbolFilePluginName()

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

◆ kSymbolLocatorPluginName()

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

◆ kTracePluginName()

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

◆ LoadPluginCallback()

static FileSystem::EnumerateDirectoryResult LoadPluginCallback ( void *  baton,
llvm::sys::fs::file_type  ft,
llvm::StringRef  path 
)
static

◆ PluginIsLoaded()

static bool PluginIsLoaded ( const FileSpec plugin_file_spec)
static

Definition at line 61 of file PluginManager.cpp.

References GetPluginMap(), and GetPluginMapMutex().

Referenced by LoadPluginCallback().

◆ SetPluginInfo()

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

Definition at line 67 of file PluginManager.cpp.

References GetPluginMap(), and GetPluginMapMutex().

Referenced by LoadPluginCallback().