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/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  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< 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 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 278 of file PluginManager.cpp.

◆ ABIInstances

Definition at line 279 of file PluginManager.cpp.

◆ ArchitectureInstance

typedef PluginInstance<ArchitectureCreateInstance> ArchitectureInstance

Definition at line 302 of file PluginManager.cpp.

◆ ArchitectureInstances

Definition at line 303 of file PluginManager.cpp.

◆ DisassemblerInstance

typedef PluginInstance<DisassemblerCreateInstance> DisassemblerInstance

Definition at line 340 of file PluginManager.cpp.

◆ DisassemblerInstances

Definition at line 341 of file PluginManager.cpp.

◆ DynamicLoaderInstance

typedef PluginInstance<DynamicLoaderCreateInstance> DynamicLoaderInstance

Definition at line 373 of file PluginManager.cpp.

◆ DynamicLoaderInstances

Definition at line 374 of file PluginManager.cpp.

◆ EmulateInstructionInstance

typedef PluginInstance<EmulateInstructionCreateInstance> EmulateInstructionInstance

Definition at line 435 of file PluginManager.cpp.

◆ EmulateInstructionInstances

Definition at line 436 of file PluginManager.cpp.

◆ InstrumentationRuntimeInstances

Definition at line 1390 of file PluginManager.cpp.

◆ JITLoaderInstance

typedef PluginInstance<JITLoaderCreateInstance> JITLoaderInstance

Definition at line 407 of file PluginManager.cpp.

◆ JITLoaderInstances

Definition at line 408 of file PluginManager.cpp.

◆ LanguageInstance

typedef PluginInstance<LanguageCreateInstance> LanguageInstance

Definition at line 502 of file PluginManager.cpp.

◆ LanguageInstances

Definition at line 503 of file PluginManager.cpp.

◆ LanguageRuntimeInstances

Definition at line 545 of file PluginManager.cpp.

◆ MemoryHistoryInstance

typedef PluginInstance<MemoryHistoryCreateInstance> MemoryHistoryInstance

Definition at line 1349 of file PluginManager.cpp.

◆ MemoryHistoryInstances

Definition at line 1350 of file PluginManager.cpp.

◆ ObjectContainerInstances

Definition at line 736 of file PluginManager.cpp.

◆ ObjectFileInstances

Definition at line 635 of file PluginManager.cpp.

◆ OperatingSystemInstance

typedef PluginInstance<OperatingSystemCreateInstance> OperatingSystemInstance

Definition at line 468 of file PluginManager.cpp.

◆ OperatingSystemInstances

Definition at line 469 of file PluginManager.cpp.

◆ PlatformInstance

typedef PluginInstance<PlatformCreateInstance> PlatformInstance

Definition at line 782 of file PluginManager.cpp.

◆ PlatformInstances

Definition at line 783 of file PluginManager.cpp.

◆ PluginInitCallback

typedef bool(* PluginInitCallback) ()

Definition at line 37 of file PluginManager.cpp.

◆ PluginTermCallback

typedef void(* PluginTermCallback) ()

Definition at line 38 of file PluginManager.cpp.

◆ PluginTerminateMap

Definition at line 48 of file PluginManager.cpp.

◆ ProcessInstance

typedef PluginInstance<ProcessCreateInstance> ProcessInstance

Definition at line 831 of file PluginManager.cpp.

◆ ProcessInstances

Definition at line 832 of file PluginManager.cpp.

◆ RegisterTypeBuilderInstances

Definition at line 888 of file PluginManager.cpp.

◆ REPLInstances

Definition at line 1493 of file PluginManager.cpp.

◆ ScriptInterpreterInstances

Definition at line 930 of file PluginManager.cpp.

◆ StructuredDataPluginInstances

Definition at line 990 of file PluginManager.cpp.

◆ SymbolFileInstance

typedef PluginInstance<SymbolFileCreateInstance> SymbolFileInstance

Definition at line 1032 of file PluginManager.cpp.

◆ SymbolFileInstances

Definition at line 1033 of file PluginManager.cpp.

◆ SymbolLocatorInstances

Definition at line 1108 of file PluginManager.cpp.

◆ SymbolVendorInstance

typedef PluginInstance<SymbolVendorCreateInstance> SymbolVendorInstance

Definition at line 1059 of file PluginManager.cpp.

◆ SymbolVendorInstances

Definition at line 1060 of file PluginManager.cpp.

◆ SystemRuntimeInstance

typedef PluginInstance<SystemRuntimeCreateInstance> SystemRuntimeInstance

Definition at line 590 of file PluginManager.cpp.

◆ SystemRuntimeInstances

Definition at line 591 of file PluginManager.cpp.

◆ TraceExporterInstances

Definition at line 1282 of file PluginManager.cpp.

◆ TraceInstances

Definition at line 1216 of file PluginManager.cpp.

◆ TypeSystemInstances

Definition at line 1440 of file PluginManager.cpp.

◆ UnwindAssemblyInstance

typedef PluginInstance<UnwindAssemblyCreateInstance> UnwindAssemblyInstance

Definition at line 1322 of file PluginManager.cpp.

◆ UnwindAssemblyInstances

Definition at line 1323 of file PluginManager.cpp.

Function Documentation

◆ CastToFPtr()

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

Definition at line 74 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

◆ 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 60 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 66 of file PluginManager.cpp.

References GetPluginMap(), and GetPluginMapMutex().

Referenced by LoadPluginCallback().