[Lldb-commits] [lldb] r181631 - <rdar://problem/13854277>
Greg Clayton
gclayton at apple.com
Fri May 10 14:47:18 PDT 2013
Author: gclayton
Date: Fri May 10 16:47:16 2013
New Revision: 181631
URL: http://llvm.org/viewvc/llvm-project?rev=181631&view=rev
Log:
<rdar://problem/13854277>
<rdar://problem/13594769>
Main changes in this patch include:
- cleanup plug-in interface and use ConstStrings for plug-in names
- Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp
- Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging
The plug-in interface changes:
Modified the lldb_private::PluginInterface class that all plug-ins inherit from:
Changed:
virtual const char * GetPluginName() = 0;
To:
virtual ConstString GetPluginName() = 0;
Removed:
virtual const char * GetShortPluginName() = 0;
- Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names.
- Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc.
Modified:
lldb/trunk/include/lldb/API/SBProcess.h
lldb/trunk/include/lldb/Core/Log.h
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/include/lldb/Core/ModuleSpec.h
lldb/trunk/include/lldb/Core/PluginInterface.h
lldb/trunk/include/lldb/Core/PluginManager.h
lldb/trunk/include/lldb/Symbol/SymbolVendor.h
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/source/API/SBProcess.cpp
lldb/trunk/source/Commands/CommandObjectLog.cpp
lldb/trunk/source/Commands/CommandObjectPlatform.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Core/DynamicLoader.cpp
lldb/trunk/source/Core/EmulateInstruction.cpp
lldb/trunk/source/Core/Log.cpp
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Core/PluginManager.cpp
lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp
lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h
lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h
lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp
lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h
lldb/trunk/source/Symbol/SymbolVendor.cpp
lldb/trunk/source/Target/OperatingSystem.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Process.cpp
Modified: lldb/trunk/include/lldb/API/SBProcess.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBProcess.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBProcess.h (original)
+++ lldb/trunk/include/lldb/API/SBProcess.h Fri May 10 16:47:16 2013
@@ -51,6 +51,7 @@ public:
const char *
GetPluginName ();
+ // DEPRECATED: use GetPluginName()
const char *
GetShortPluginName ();
Modified: lldb/trunk/include/lldb/Core/Log.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Log.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Log.h (original)
+++ lldb/trunk/include/lldb/Core/Log.h Fri May 10 16:47:16 2013
@@ -78,14 +78,14 @@ public:
// Static accessors for logging channels
//------------------------------------------------------------------
static void
- RegisterLogChannel (const char *channel,
+ RegisterLogChannel (const ConstString &channel,
const Log::Callbacks &log_callbacks);
static bool
- UnregisterLogChannel (const char *channel);
+ UnregisterLogChannel (const ConstString &channel);
static bool
- GetLogChannelCallbacks (const char *channel,
+ GetLogChannelCallbacks (const ConstString &channel,
Log::Callbacks &log_callbacks);
Modified: lldb/trunk/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Module.h (original)
+++ lldb/trunk/include/lldb/Core/Module.h Fri May 10 16:47:16 2013
@@ -88,7 +88,8 @@ public:
Module (const FileSpec& file_spec,
const ArchSpec& arch,
const ConstString *object_name = NULL,
- off_t object_offset = 0);
+ off_t object_offset = 0,
+ const TimeValue *object_mod_time_ptr = NULL);
Module (const ModuleSpec &module_spec);
//------------------------------------------------------------------
@@ -552,8 +553,23 @@ public:
SetSymbolFileFileSpec (const FileSpec &file);
const TimeValue &
- GetModificationTime () const;
-
+ GetModificationTime () const
+ {
+ return m_mod_time;
+ }
+
+ const TimeValue &
+ GetObjectModificationTime () const
+ {
+ return m_object_mod_time;
+ }
+
+ void
+ SetObjectModificationTime (const TimeValue &mod_time)
+ {
+ m_mod_time = mod_time;
+ }
+
//------------------------------------------------------------------
/// Tells whether this module is capable of being the main executable
/// for a process.
@@ -963,6 +979,7 @@ protected:
FileSpec m_symfile_spec; ///< If this path is valid, then this is the file that _will_ be used as the symbol file for this module
ConstString m_object_name; ///< The name an object within this module that is selected, or empty of the module is represented by \a m_file.
uint64_t m_object_offset;
+ TimeValue m_object_mod_time;
lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile
std::unique_ptr<SymbolVendor> m_symfile_ap; ///< A pointer to the symbol vendor for this module.
ClangASTContext m_ast; ///< The AST context for this module.
Modified: lldb/trunk/include/lldb/Core/ModuleSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ModuleSpec.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ModuleSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ModuleSpec.h Fri May 10 16:47:16 2013
@@ -28,6 +28,7 @@ public:
m_uuid (),
m_object_name (),
m_object_offset (0),
+ m_object_mod_time (),
m_source_mappings ()
{
}
@@ -40,6 +41,7 @@ public:
m_uuid (),
m_object_name (),
m_object_offset (0),
+ m_object_mod_time (),
m_source_mappings ()
{
}
@@ -52,6 +54,7 @@ public:
m_uuid (),
m_object_name (),
m_object_offset (0),
+ m_object_mod_time (),
m_source_mappings ()
{
}
@@ -64,6 +67,7 @@ public:
m_uuid (rhs.m_uuid),
m_object_name (rhs.m_object_name),
m_object_offset (rhs.m_object_offset),
+ m_object_mod_time (rhs.m_object_mod_time),
m_source_mappings (rhs.m_source_mappings)
{
}
@@ -80,6 +84,7 @@ public:
m_uuid = rhs.m_uuid;
m_object_name = rhs.m_object_name;
m_object_offset = rhs.m_object_offset;
+ m_object_mod_time = rhs.m_object_mod_time;
m_source_mappings = rhs.m_source_mappings;
}
return *this;
@@ -248,6 +253,18 @@ public:
{
m_object_offset = object_offset;
}
+
+ TimeValue &
+ GetObjectModificationTime ()
+ {
+ return m_object_mod_time;
+ }
+
+ const TimeValue &
+ GetObjectModificationTime () const
+ {
+ return m_object_mod_time;
+ }
PathMappingList &
GetSourceMappingList () const
@@ -266,6 +283,7 @@ public:
m_object_name.Clear();
m_object_offset = 0;
m_source_mappings.Clear(false);
+ m_object_mod_time.Clear();
}
protected:
@@ -276,6 +294,7 @@ protected:
UUID m_uuid;
ConstString m_object_name;
uint64_t m_object_offset;
+ TimeValue m_object_mod_time;
mutable PathMappingList m_source_mappings;
};
Modified: lldb/trunk/include/lldb/Core/PluginInterface.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginInterface.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/PluginInterface.h (original)
+++ lldb/trunk/include/lldb/Core/PluginInterface.h Fri May 10 16:47:16 2013
@@ -24,12 +24,9 @@ public:
virtual
~PluginInterface () {}
- virtual const char *
+ virtual ConstString
GetPluginName() = 0;
- virtual const char *
- GetShortPluginName() = 0;
-
virtual uint32_t
GetPluginVersion() = 0;
Modified: lldb/trunk/include/lldb/Core/PluginManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/PluginManager.h (original)
+++ lldb/trunk/include/lldb/Core/PluginManager.h Fri May 10 16:47:16 2013
@@ -29,7 +29,7 @@ public:
// ABI
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
ABICreateInstance create_callback);
@@ -40,14 +40,14 @@ public:
GetABICreateCallbackAtIndex (uint32_t idx);
static ABICreateInstance
- GetABICreateCallbackForPluginName (const char *name);
+ GetABICreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// Disassembler
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
DisassemblerCreateInstance create_callback);
@@ -58,14 +58,14 @@ public:
GetDisassemblerCreateCallbackAtIndex (uint32_t idx);
static DisassemblerCreateInstance
- GetDisassemblerCreateCallbackForPluginName (const char *name);
+ GetDisassemblerCreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// DynamicLoader
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
DynamicLoaderCreateInstance create_callback,
DebuggerInitializeCallback debugger_init_callback = NULL);
@@ -77,13 +77,13 @@ public:
GetDynamicLoaderCreateCallbackAtIndex (uint32_t idx);
static DynamicLoaderCreateInstance
- GetDynamicLoaderCreateCallbackForPluginName (const char *name);
+ GetDynamicLoaderCreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// EmulateInstruction
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
EmulateInstructionCreateInstance create_callback);
@@ -94,13 +94,13 @@ public:
GetEmulateInstructionCreateCallbackAtIndex (uint32_t idx);
static EmulateInstructionCreateInstance
- GetEmulateInstructionCreateCallbackForPluginName (const char *name);
+ GetEmulateInstructionCreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// OperatingSystem
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
OperatingSystemCreateInstance create_callback);
@@ -111,13 +111,13 @@ public:
GetOperatingSystemCreateCallbackAtIndex (uint32_t idx);
static OperatingSystemCreateInstance
- GetOperatingSystemCreateCallbackForPluginName (const char *name);
+ GetOperatingSystemCreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// LanguageRuntime
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
LanguageRuntimeCreateInstance create_callback);
@@ -128,14 +128,14 @@ public:
GetLanguageRuntimeCreateCallbackAtIndex (uint32_t idx);
static LanguageRuntimeCreateInstance
- GetLanguageRuntimeCreateCallbackForPluginName (const char *name);
+ GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// ObjectFile
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
ObjectFileCreateInstance create_callback,
ObjectFileCreateMemoryInstance create_memory_callback,
@@ -154,17 +154,17 @@ public:
GetObjectFileGetModuleSpecificationsCallbackAtIndex (uint32_t idx);
static ObjectFileCreateInstance
- GetObjectFileCreateCallbackForPluginName (const char *name);
+ GetObjectFileCreateCallbackForPluginName (const ConstString &name);
static ObjectFileCreateMemoryInstance
- GetObjectFileCreateMemoryCallbackForPluginName (const char *name);
+ GetObjectFileCreateMemoryCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// ObjectContainer
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
ObjectContainerCreateInstance create_callback,
ObjectFileGetModuleSpecifications get_module_specifications);
@@ -176,7 +176,7 @@ public:
GetObjectContainerCreateCallbackAtIndex (uint32_t idx);
static ObjectContainerCreateInstance
- GetObjectContainerCreateCallbackForPluginName (const char *name);
+ GetObjectContainerCreateCallbackForPluginName (const ConstString &name);
static ObjectFileGetModuleSpecifications
GetObjectContainerGetModuleSpecificationsCallbackAtIndex (uint32_t idx);
@@ -185,7 +185,7 @@ public:
// LogChannel
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
LogChannelCreateInstance create_callback);
@@ -196,7 +196,7 @@ public:
GetLogChannelCreateCallbackAtIndex (uint32_t idx);
static LogChannelCreateInstance
- GetLogChannelCreateCallbackForPluginName (const char *name);
+ GetLogChannelCreateCallbackForPluginName (const ConstString &name);
static const char *
GetLogChannelCreateNameAtIndex (uint32_t idx);
@@ -205,7 +205,7 @@ public:
// Platform
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
PlatformCreateInstance create_callback,
DebuggerInitializeCallback debugger_init_callback = NULL);
@@ -217,7 +217,7 @@ public:
GetPlatformCreateCallbackAtIndex (uint32_t idx);
static PlatformCreateInstance
- GetPlatformCreateCallbackForPluginName (const char *name);
+ GetPlatformCreateCallbackForPluginName (const ConstString &name);
static const char *
GetPlatformPluginNameAtIndex (uint32_t idx);
@@ -232,7 +232,7 @@ public:
// Process
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
ProcessCreateInstance create_callback);
@@ -243,7 +243,7 @@ public:
GetProcessCreateCallbackAtIndex (uint32_t idx);
static ProcessCreateInstance
- GetProcessCreateCallbackForPluginName (const char *name);
+ GetProcessCreateCallbackForPluginName (const ConstString &name);
static const char *
GetProcessPluginNameAtIndex (uint32_t idx);
@@ -255,7 +255,7 @@ public:
// SymbolFile
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
SymbolFileCreateInstance create_callback);
@@ -266,14 +266,14 @@ public:
GetSymbolFileCreateCallbackAtIndex (uint32_t idx);
static SymbolFileCreateInstance
- GetSymbolFileCreateCallbackForPluginName (const char *name);
+ GetSymbolFileCreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// SymbolVendor
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
SymbolVendorCreateInstance create_callback);
@@ -284,13 +284,13 @@ public:
GetSymbolVendorCreateCallbackAtIndex (uint32_t idx);
static SymbolVendorCreateInstance
- GetSymbolVendorCreateCallbackForPluginName (const char *name);
+ GetSymbolVendorCreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// UnwindAssembly
//------------------------------------------------------------------
static bool
- RegisterPlugin (const char *name,
+ RegisterPlugin (const ConstString &name,
const char *description,
UnwindAssemblyCreateInstance create_callback);
@@ -301,7 +301,7 @@ public:
GetUnwindAssemblyCreateCallbackAtIndex (uint32_t idx);
static UnwindAssemblyCreateInstance
- GetUnwindAssemblyCreateCallbackForPluginName (const char *name);
+ GetUnwindAssemblyCreateCallbackForPluginName (const ConstString &name);
//------------------------------------------------------------------
// Some plug-ins might register a DebuggerInitializeCallback
Modified: lldb/trunk/include/lldb/Symbol/SymbolVendor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolVendor.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/SymbolVendor.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolVendor.h Fri May 10 16:47:16 2013
@@ -36,15 +36,6 @@ class SymbolVendor :
public PluginInterface
{
public:
- static bool
- RegisterPlugin (const char *name,
- const char *description,
- SymbolVendorCreateInstance create_callback);
-
- static bool
- UnregisterPlugin (SymbolVendorCreateInstance create_callback);
-
-
static SymbolVendor*
FindPlugin (const lldb::ModuleSP &module_sp,
lldb_private::Stream *feedback_strm);
@@ -171,12 +162,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Fri May 10 16:47:16 2013
@@ -108,7 +108,7 @@ namespace lldb_private {
/// should be used. If NULL, pick the best plug-in.
//------------------------------------------------------------------
static Platform*
- FindPlugin (Process *process, const char *plugin_name);
+ FindPlugin (Process *process, const ConstString &plugin_name);
//------------------------------------------------------------------
/// Set the target's executable based off of the existing
@@ -215,7 +215,7 @@ namespace lldb_private {
// Returns the the hostname if we are connected, else the short plugin
// name.
- const char *
+ ConstString
GetName ();
virtual const char *
Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Fri May 10 16:47:16 2013
@@ -1747,7 +1747,7 @@ public:
DoLoadCore ()
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support loading core files.", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support loading core files.", GetPluginName().GetCString());
return error;
}
@@ -2059,7 +2059,7 @@ public:
DoAttachToProcessWithID (lldb::pid_t pid)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetPluginName().GetCString());
return error;
}
@@ -2082,7 +2082,7 @@ public:
DoAttachToProcessWithID (lldb::pid_t pid, const ProcessAttachInfo &attach_info)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetPluginName().GetCString());
return error;
}
@@ -2208,7 +2208,7 @@ public:
const ProcessLaunchInfo &launch_info)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support launching processes", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support launching processes", GetPluginName().GetCString());
return error;
}
@@ -2257,7 +2257,7 @@ public:
DoResume ()
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support resuming processes", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support resuming processes", GetPluginName().GetCString());
return error;
}
@@ -2306,7 +2306,7 @@ public:
DoHalt (bool &caused_stop)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support halting processes", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support halting processes", GetPluginName().GetCString());
return error;
}
@@ -2346,7 +2346,7 @@ public:
DoDetach (bool keep_stopped)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support detaching from processes", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support detaching from processes", GetPluginName().GetCString());
return error;
}
@@ -2387,7 +2387,7 @@ public:
DoSignal (int signal)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support senging signals to processes", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support senging signals to processes", GetPluginName().GetCString());
return error;
}
@@ -2817,7 +2817,7 @@ public:
virtual size_t
DoWriteMemory (lldb::addr_t vm_addr, const void *buf, size_t size, Error &error)
{
- error.SetErrorStringWithFormat("error: %s does not support writing to processes", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support writing to processes", GetPluginName().GetCString());
return 0;
}
@@ -2914,7 +2914,7 @@ public:
virtual lldb::addr_t
DoAllocateMemory (size_t size, uint32_t permissions, Error &error)
{
- error.SetErrorStringWithFormat("error: %s does not support allocating in the debug process", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support allocating in the debug process", GetPluginName().GetCString());
return LLDB_INVALID_ADDRESS;
}
@@ -2963,7 +2963,7 @@ public:
virtual lldb::addr_t
ResolveIndirectFunction(const Address *address, Error &error)
{
- error.SetErrorStringWithFormat("error: %s does not support indirect functions in the debug process", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support indirect functions in the debug process", GetPluginName().GetCString());
return LLDB_INVALID_ADDRESS;
}
@@ -3084,7 +3084,7 @@ public:
DoDeallocateMemory (lldb::addr_t ptr)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support deallocating in the debug process", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support deallocating in the debug process", GetPluginName().GetCString());
return error;
}
@@ -3189,7 +3189,7 @@ public:
EnableBreakpointSite (BreakpointSite *bp_site)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support enabling breakpoints", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support enabling breakpoints", GetPluginName().GetCString());
return error;
}
@@ -3198,7 +3198,7 @@ public:
DisableBreakpointSite (BreakpointSite *bp_site)
{
Error error;
- error.SetErrorStringWithFormat("error: %s does not support disabling breakpoints", GetShortPluginName());
+ error.SetErrorStringWithFormat("error: %s does not support disabling breakpoints", GetPluginName().GetCString());
return error;
}
Modified: lldb/trunk/source/API/SBProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/API/SBProcess.cpp (original)
+++ lldb/trunk/source/API/SBProcess.cpp Fri May 10 16:47:16 2013
@@ -89,7 +89,7 @@ SBProcess::GetPluginName ()
ProcessSP process_sp(GetSP());
if (process_sp)
{
- return process_sp->GetPluginName();
+ return process_sp->GetPluginName().GetCString();
}
return "<Unknown>";
}
@@ -100,7 +100,7 @@ SBProcess::GetShortPluginName ()
ProcessSP process_sp(GetSP());
if (process_sp)
{
- return process_sp->GetShortPluginName();
+ return process_sp->GetPluginName().GetCString();
}
return "<Unknown>";
}
Modified: lldb/trunk/source/Commands/CommandObjectLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectLog.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectLog.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectLog.cpp Fri May 10 16:47:16 2013
@@ -282,7 +282,7 @@ protected:
std::string channel(args.GetArgumentAtIndex(0));
args.Shift (); // Shift off the channel
- if (Log::GetLogChannelCallbacks (channel.c_str(), log_callbacks))
+ if (Log::GetLogChannelCallbacks (ConstString(channel.c_str()), log_callbacks))
{
log_callbacks.disable (args.GetConstArgumentVector(), &result.GetErrorStream());
result.SetStatus(eReturnStatusSuccessFinishNoResult);
@@ -356,7 +356,7 @@ protected:
Log::Callbacks log_callbacks;
std::string channel(args.GetArgumentAtIndex(i));
- if (Log::GetLogChannelCallbacks (channel.c_str(), log_callbacks))
+ if (Log::GetLogChannelCallbacks (ConstString(channel.c_str()), log_callbacks))
{
log_callbacks.list_categories (&result.GetOutputStream());
result.SetStatus(eReturnStatusSuccessFinishResult);
Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Fri May 10 16:47:16 2013
@@ -155,7 +155,7 @@ protected:
PlatformSP host_platform_sp (Platform::GetDefaultPlatform());
ostrm.Printf ("%s: %s\n",
- host_platform_sp->GetShortPluginName(),
+ host_platform_sp->GetPluginName().GetCString(),
host_platform_sp->GetDescription());
uint32_t idx;
@@ -326,7 +326,7 @@ protected:
{
Stream &ostrm = result.GetOutputStream();
if (hostname.empty())
- ostrm.Printf ("Disconnected from \"%s\"\n", platform_sp->GetShortPluginName());
+ ostrm.Printf ("Disconnected from \"%s\"\n", platform_sp->GetPluginName().GetCString());
else
ostrm.Printf ("Disconnected from \"%s\"\n", hostname.c_str());
result.SetStatus (eReturnStatusSuccessFinishResult);
@@ -340,7 +340,7 @@ protected:
else
{
// Not connected...
- result.AppendErrorWithFormat ("not connected to '%s'", platform_sp->GetShortPluginName());
+ result.AppendErrorWithFormat ("not connected to '%s'", platform_sp->GetPluginName().GetCString());
result.SetStatus (eReturnStatusFailed);
}
}
@@ -570,9 +570,9 @@ protected:
result.AppendErrorWithFormat ("no processes were found that %s \"%s\" on the \"%s\" platform\n",
match_desc,
match_name,
- platform_sp->GetShortPluginName());
+ platform_sp->GetPluginName().GetCString());
else
- result.AppendErrorWithFormat ("no processes were found on the \"%s\" platform\n", platform_sp->GetShortPluginName());
+ result.AppendErrorWithFormat ("no processes were found on the \"%s\" platform\n", platform_sp->GetPluginName().GetCString());
result.SetStatus (eReturnStatusFailed);
}
else
@@ -580,7 +580,7 @@ protected:
result.AppendMessageWithFormat ("%u matching process%s found on \"%s\"",
matches,
matches > 1 ? "es were" : " was",
- platform_sp->GetName());
+ platform_sp->GetName().GetCString());
if (match_desc)
result.AppendMessageWithFormat (" whose name %s \"%s\"",
match_desc,
@@ -848,7 +848,7 @@ protected:
else
{
// Not connected...
- result.AppendErrorWithFormat ("not connected to '%s'", platform_sp->GetShortPluginName());
+ result.AppendErrorWithFormat ("not connected to '%s'", platform_sp->GetPluginName().GetCString());
result.SetStatus (eReturnStatusFailed);
}
}
Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Fri May 10 16:47:16 2013
@@ -81,7 +81,7 @@ DumpTargetInfo (uint32_t target_idx, Tar
}
PlatformSP platform_sp (target->GetPlatform());
if (platform_sp)
- strm.Printf ("%splatform=%s", properties++ > 0 ? ", " : " ( ", platform_sp->GetName());
+ strm.Printf ("%splatform=%s", properties++ > 0 ? ", " : " ( ", platform_sp->GetName().GetCString());
ProcessSP process_sp (target->GetProcessSP());
bool show_process_status = false;
Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Fri May 10 16:47:16 2013
@@ -2644,7 +2644,7 @@ Debugger::EnableLog (const char *channel
if (log_options == 0)
log_options = LLDB_LOG_OPTION_PREPEND_THREAD_NAME | LLDB_LOG_OPTION_THREADSAFE;
- if (Log::GetLogChannelCallbacks (channel, log_callbacks))
+ if (Log::GetLogChannelCallbacks (ConstString(channel), log_callbacks))
{
log_callbacks.enable (log_stream_sp, log_options, categories, &error_stream);
return true;
Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Fri May 10 16:47:16 2013
@@ -56,7 +56,8 @@ Disassembler::FindPlugin (const ArchSpec
if (plugin_name)
{
- create_callback = PluginManager::GetDisassemblerCreateCallbackForPluginName (plugin_name);
+ ConstString const_plugin_name (plugin_name);
+ create_callback = PluginManager::GetDisassemblerCreateCallbackForPluginName (const_plugin_name);
if (create_callback)
{
DisassemblerSP disassembler_sp(create_callback(arch, flavor));
Modified: lldb/trunk/source/Core/DynamicLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DynamicLoader.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Core/DynamicLoader.cpp (original)
+++ lldb/trunk/source/Core/DynamicLoader.cpp Fri May 10 16:47:16 2013
@@ -21,7 +21,8 @@ DynamicLoader::FindPlugin (Process *proc
DynamicLoaderCreateInstance create_callback = NULL;
if (plugin_name)
{
- create_callback = PluginManager::GetDynamicLoaderCreateCallbackForPluginName (plugin_name);
+ ConstString const_plugin_name(plugin_name);
+ create_callback = PluginManager::GetDynamicLoaderCreateCallbackForPluginName (const_plugin_name);
if (create_callback)
{
std::unique_ptr<DynamicLoader> instance_ap(create_callback(process, true));
Modified: lldb/trunk/source/Core/EmulateInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Core/EmulateInstruction.cpp (original)
+++ lldb/trunk/source/Core/EmulateInstruction.cpp Fri May 10 16:47:16 2013
@@ -32,7 +32,8 @@ EmulateInstruction::FindPlugin (const Ar
EmulateInstructionCreateInstance create_callback = NULL;
if (plugin_name)
{
- create_callback = PluginManager::GetEmulateInstructionCreateCallbackForPluginName (plugin_name);
+ ConstString const_plugin_name (plugin_name);
+ create_callback = PluginManager::GetEmulateInstructionCreateCallbackForPluginName (const_plugin_name);
if (create_callback)
{
EmulateInstruction *emulate_insn_ptr = create_callback(arch, supported_inst_type);
Modified: lldb/trunk/source/Core/Log.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Log.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Core/Log.cpp (original)
+++ lldb/trunk/source/Core/Log.cpp Fri May 10 16:47:16 2013
@@ -313,7 +313,7 @@ Log::Warning (const char *format, ...)
}
}
-typedef std::map <std::string, Log::Callbacks> CallbackMap;
+typedef std::map <ConstString, Log::Callbacks> CallbackMap;
typedef CallbackMap::iterator CallbackMapIter;
typedef std::map <ConstString, LogChannelSP> LogChannelMap;
@@ -337,19 +337,19 @@ GetChannelMap ()
}
void
-Log::RegisterLogChannel (const char *channel, const Log::Callbacks &log_callbacks)
+Log::RegisterLogChannel (const ConstString &channel, const Log::Callbacks &log_callbacks)
{
GetCallbackMap().insert(std::make_pair(channel, log_callbacks));
}
bool
-Log::UnregisterLogChannel (const char *channel)
+Log::UnregisterLogChannel (const ConstString &channel)
{
return GetCallbackMap().erase(channel) != 0;
}
bool
-Log::GetLogChannelCallbacks (const char *channel, Log::Callbacks &log_callbacks)
+Log::GetLogChannelCallbacks (const ConstString &channel, Log::Callbacks &log_callbacks)
{
CallbackMap &callback_map = GetCallbackMap ();
CallbackMapIter pos = callback_map.find(channel);
@@ -427,7 +427,7 @@ void
Log::Initialize()
{
Log::Callbacks log_callbacks = { DisableLog, EnableLog, ListLogCategories };
- Log::RegisterLogChannel ("lldb", log_callbacks);
+ Log::RegisterLogChannel (ConstString("lldb"), log_callbacks);
}
void
@@ -495,7 +495,8 @@ LogChannel::FindPlugin (const char *plug
LogChannelMapIter pos = channel_map.find (log_channel_name);
if (pos == channel_map.end())
{
- LogChannelCreateInstance create_callback = PluginManager::GetLogChannelCreateCallbackForPluginName (plugin_name);
+ ConstString const_plugin_name (plugin_name);
+ LogChannelCreateInstance create_callback = PluginManager::GetLogChannelCreateCallbackForPluginName (const_plugin_name);
if (create_callback)
{
log_channel_sp.reset(create_callback());
Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Fri May 10 16:47:16 2013
@@ -136,6 +136,7 @@ Module::Module (const ModuleSpec &module
m_symfile_spec (module_spec.GetSymbolFileSpec()),
m_object_name (module_spec.GetObjectName()),
m_object_offset (module_spec.GetObjectOffset()),
+ m_object_mod_time (module_spec.GetObjectModificationTime()),
m_objfile_sp (),
m_symfile_ap (),
m_ast (),
@@ -168,7 +169,8 @@ Module::Module (const ModuleSpec &module
Module::Module(const FileSpec& file_spec,
const ArchSpec& arch,
const ConstString *object_name,
- off_t object_offset) :
+ off_t object_offset,
+ const TimeValue *object_mod_time_ptr) :
m_mutex (Mutex::eMutexTypeRecursive),
m_mod_time (file_spec.GetModificationTime()),
m_arch (arch),
@@ -178,6 +180,7 @@ Module::Module(const FileSpec& file_spec
m_symfile_spec (),
m_object_name (),
m_object_offset (object_offset),
+ m_object_mod_time (),
m_objfile_sp (),
m_symfile_ap (),
m_ast (),
@@ -198,6 +201,10 @@ Module::Module(const FileSpec& file_spec
if (object_name)
m_object_name = *object_name;
+
+ if (object_mod_time_ptr)
+ m_object_mod_time = *object_mod_time_ptr;
+
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES));
if (log)
log->Printf ("%p Module::Module((%s) '%s%s%s%s')",
@@ -1186,12 +1193,6 @@ Module::FindSymbolsMatchingRegExAndType
return sc_list.GetSize() - initial_size;
}
-const TimeValue &
-Module::GetModificationTime () const
-{
- return m_mod_time;
-}
-
void
Module::SetSymbolFileFileSpec (const FileSpec &file)
{
Modified: lldb/trunk/source/Core/PluginManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Core/PluginManager.cpp (original)
+++ lldb/trunk/source/Core/PluginManager.cpp Fri May 10 16:47:16 2013
@@ -233,7 +233,7 @@ struct ABIInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
ABICreateInstance create_callback;
};
@@ -257,7 +257,7 @@ GetABIInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
ABICreateInstance create_callback
)
@@ -265,8 +265,8 @@ PluginManager::RegisterPlugin
if (create_callback)
{
ABIInstance instance;
- assert (name && name[0]);
- instance.name.assign (name);
+ assert ((bool)name);
+ instance.name = name;
if (description && description[0])
instance.description = description;
instance.create_callback = create_callback;
@@ -309,18 +309,17 @@ PluginManager::GetABICreateCallbackAtInd
}
ABICreateInstance
-PluginManager::GetABICreateCallbackForPluginName (const char *name)
+PluginManager::GetABICreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
Mutex::Locker locker (GetABIInstancesMutex ());
- llvm::StringRef name_sref(name);
ABIInstances &instances = GetABIInstances ();
ABIInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -340,7 +339,7 @@ struct DisassemblerInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
DisassemblerCreateInstance create_callback;
};
@@ -364,7 +363,7 @@ GetDisassemblerInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
DisassemblerCreateInstance create_callback
)
@@ -372,7 +371,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
DisassemblerInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -416,18 +415,17 @@ PluginManager::GetDisassemblerCreateCall
}
DisassemblerCreateInstance
-PluginManager::GetDisassemblerCreateCallbackForPluginName (const char *name)
+PluginManager::GetDisassemblerCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetDisassemblerMutex ());
DisassemblerInstances &instances = GetDisassemblerInstances ();
DisassemblerInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -449,7 +447,7 @@ struct DynamicLoaderInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
DynamicLoaderCreateInstance create_callback;
DebuggerInitializeCallback debugger_init_callback;
@@ -476,7 +474,7 @@ GetDynamicLoaderInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
DynamicLoaderCreateInstance create_callback,
DebuggerInitializeCallback debugger_init_callback
@@ -485,7 +483,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
DynamicLoaderInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -529,18 +527,17 @@ PluginManager::GetDynamicLoaderCreateCal
}
DynamicLoaderCreateInstance
-PluginManager::GetDynamicLoaderCreateCallbackForPluginName (const char *name)
+PluginManager::GetDynamicLoaderCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetDynamicLoaderMutex ());
DynamicLoaderInstances &instances = GetDynamicLoaderInstances ();
DynamicLoaderInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -559,7 +556,7 @@ struct EmulateInstructionInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
EmulateInstructionCreateInstance create_callback;
};
@@ -584,7 +581,7 @@ GetEmulateInstructionInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
EmulateInstructionCreateInstance create_callback
)
@@ -592,7 +589,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
EmulateInstructionInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -635,18 +632,17 @@ PluginManager::GetEmulateInstructionCrea
}
EmulateInstructionCreateInstance
-PluginManager::GetEmulateInstructionCreateCallbackForPluginName (const char *name)
+PluginManager::GetEmulateInstructionCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetEmulateInstructionMutex ());
EmulateInstructionInstances &instances = GetEmulateInstructionInstances ();
EmulateInstructionInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -664,7 +660,7 @@ struct OperatingSystemInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
OperatingSystemCreateInstance create_callback;
};
@@ -686,17 +682,14 @@ GetOperatingSystemInstances ()
}
bool
-PluginManager::RegisterPlugin
-(
- const char *name,
- const char *description,
- OperatingSystemCreateInstance create_callback
- )
+PluginManager::RegisterPlugin (const ConstString &name,
+ const char *description,
+ OperatingSystemCreateInstance create_callback)
{
if (create_callback)
{
OperatingSystemInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -739,18 +732,17 @@ PluginManager::GetOperatingSystemCreateC
}
OperatingSystemCreateInstance
-PluginManager::GetOperatingSystemCreateCallbackForPluginName (const char *name)
+PluginManager::GetOperatingSystemCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetOperatingSystemMutex ());
OperatingSystemInstances &instances = GetOperatingSystemInstances ();
OperatingSystemInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -770,7 +762,7 @@ struct LanguageRuntimeInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
LanguageRuntimeCreateInstance create_callback;
};
@@ -794,7 +786,7 @@ GetLanguageRuntimeInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
LanguageRuntimeCreateInstance create_callback
)
@@ -802,7 +794,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
LanguageRuntimeInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -845,18 +837,17 @@ PluginManager::GetLanguageRuntimeCreateC
}
LanguageRuntimeCreateInstance
-PluginManager::GetLanguageRuntimeCreateCallbackForPluginName (const char *name)
+PluginManager::GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetLanguageRuntimeMutex ());
LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances ();
LanguageRuntimeInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -876,7 +867,7 @@ struct ObjectFileInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
ObjectFileCreateInstance create_callback;
ObjectFileCreateMemoryInstance create_memory_callback;
@@ -901,7 +892,7 @@ GetObjectFileInstances ()
bool
-PluginManager::RegisterPlugin (const char *name,
+PluginManager::RegisterPlugin (const ConstString &name,
const char *description,
ObjectFileCreateInstance create_callback,
ObjectFileCreateMemoryInstance create_memory_callback,
@@ -910,7 +901,7 @@ PluginManager::RegisterPlugin (const cha
if (create_callback)
{
ObjectFileInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -976,18 +967,17 @@ PluginManager::GetObjectFileGetModuleSpe
}
ObjectFileCreateInstance
-PluginManager::GetObjectFileCreateCallbackForPluginName (const char *name)
+PluginManager::GetObjectFileCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetObjectFileMutex ());
ObjectFileInstances &instances = GetObjectFileInstances ();
ObjectFileInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -996,18 +986,17 @@ PluginManager::GetObjectFileCreateCallba
ObjectFileCreateMemoryInstance
-PluginManager::GetObjectFileCreateMemoryCallbackForPluginName (const char *name)
+PluginManager::GetObjectFileCreateMemoryCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetObjectFileMutex ());
ObjectFileInstances &instances = GetObjectFileInstances ();
ObjectFileInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_memory_callback;
}
}
@@ -1028,7 +1017,7 @@ struct ObjectContainerInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
ObjectContainerCreateInstance create_callback;
ObjectFileGetModuleSpecifications get_module_specifications;
@@ -1052,7 +1041,7 @@ GetObjectContainerInstances ()
}
bool
-PluginManager::RegisterPlugin (const char *name,
+PluginManager::RegisterPlugin (const ConstString &name,
const char *description,
ObjectContainerCreateInstance create_callback,
ObjectFileGetModuleSpecifications get_module_specifications)
@@ -1060,7 +1049,7 @@ PluginManager::RegisterPlugin (const cha
if (create_callback)
{
ObjectContainerInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -1104,18 +1093,17 @@ PluginManager::GetObjectContainerCreateC
}
ObjectContainerCreateInstance
-PluginManager::GetObjectContainerCreateCallbackForPluginName (const char *name)
+PluginManager::GetObjectContainerCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetObjectContainerMutex ());
ObjectContainerInstances &instances = GetObjectContainerInstances ();
ObjectContainerInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -1143,7 +1131,7 @@ struct LogInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
LogChannelCreateInstance create_callback;
};
@@ -1169,7 +1157,7 @@ GetLogInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
LogChannelCreateInstance create_callback
)
@@ -1177,7 +1165,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
LogInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -1215,7 +1203,7 @@ PluginManager::GetLogChannelCreateNameAt
Mutex::Locker locker (GetLogMutex ());
LogInstances &instances = GetLogInstances ();
if (idx < instances.size())
- return instances[idx].name.c_str();
+ return instances[idx].name.GetCString();
return NULL;
}
@@ -1231,18 +1219,17 @@ PluginManager::GetLogChannelCreateCallba
}
LogChannelCreateInstance
-PluginManager::GetLogChannelCreateCallbackForPluginName (const char *name)
+PluginManager::GetLogChannelCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetLogMutex ());
LogInstances &instances = GetLogInstances ();
LogInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -1261,7 +1248,7 @@ struct PlatformInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
PlatformCreateInstance create_callback;
DebuggerInitializeCallback debugger_init_callback;
@@ -1285,7 +1272,7 @@ GetPlatformInstances ()
bool
-PluginManager::RegisterPlugin (const char *name,
+PluginManager::RegisterPlugin (const ConstString &name,
const char *description,
PlatformCreateInstance create_callback,
DebuggerInitializeCallback debugger_init_callback)
@@ -1295,7 +1282,7 @@ PluginManager::RegisterPlugin (const cha
Mutex::Locker locker (GetPlatformInstancesMutex ());
PlatformInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -1314,7 +1301,7 @@ PluginManager::GetPlatformPluginNameAtIn
Mutex::Locker locker (GetPlatformInstancesMutex ());
PlatformInstances &instances = GetPlatformInstances ();
if (idx < instances.size())
- return instances[idx].name.c_str();
+ return instances[idx].name.GetCString();
return NULL;
}
@@ -1360,18 +1347,17 @@ PluginManager::GetPlatformCreateCallback
}
PlatformCreateInstance
-PluginManager::GetPlatformCreateCallbackForPluginName (const char *name)
+PluginManager::GetPlatformCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
Mutex::Locker locker (GetPlatformInstancesMutex ());
PlatformInstances &instances = GetPlatformInstances ();
- llvm::StringRef name_sref(name);
PlatformInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -1381,7 +1367,7 @@ PluginManager::GetPlatformCreateCallback
size_t
PluginManager::AutoCompletePlatformName (const char *name, StringList &matches)
{
- if (name && name[0])
+ if (name)
{
Mutex::Locker locker (GetPlatformInstancesMutex ());
PlatformInstances &instances = GetPlatformInstances ();
@@ -1390,7 +1376,7 @@ PluginManager::AutoCompletePlatformName
PlatformInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- llvm::StringRef plugin_name (pos->name);
+ llvm::StringRef plugin_name (pos->name.GetCString());
if (plugin_name.startswith(name_sref))
matches.AppendString (plugin_name.data());
}
@@ -1408,7 +1394,7 @@ struct ProcessInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
ProcessCreateInstance create_callback;
};
@@ -1433,7 +1419,7 @@ GetProcessInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
ProcessCreateInstance create_callback
)
@@ -1441,7 +1427,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
ProcessInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -1458,7 +1444,7 @@ PluginManager::GetProcessPluginNameAtInd
Mutex::Locker locker (GetProcessMutex ());
ProcessInstances &instances = GetProcessInstances ();
if (idx < instances.size())
- return instances[idx].name.c_str();
+ return instances[idx].name.GetCString();
return NULL;
}
@@ -1505,18 +1491,17 @@ PluginManager::GetProcessCreateCallbackA
ProcessCreateInstance
-PluginManager::GetProcessCreateCallbackForPluginName (const char *name)
+PluginManager::GetProcessCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetProcessMutex ());
ProcessInstances &instances = GetProcessInstances ();
ProcessInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -1534,7 +1519,7 @@ struct SymbolFileInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
SymbolFileCreateInstance create_callback;
};
@@ -1559,7 +1544,7 @@ GetSymbolFileInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
SymbolFileCreateInstance create_callback
)
@@ -1567,7 +1552,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
SymbolFileInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -1610,18 +1595,17 @@ PluginManager::GetSymbolFileCreateCallba
}
SymbolFileCreateInstance
-PluginManager::GetSymbolFileCreateCallbackForPluginName (const char *name)
+PluginManager::GetSymbolFileCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetSymbolFileMutex ());
SymbolFileInstances &instances = GetSymbolFileInstances ();
SymbolFileInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -1641,7 +1625,7 @@ struct SymbolVendorInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
SymbolVendorCreateInstance create_callback;
};
@@ -1665,7 +1649,7 @@ GetSymbolVendorInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
SymbolVendorCreateInstance create_callback
)
@@ -1673,7 +1657,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
SymbolVendorInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -1717,18 +1701,17 @@ PluginManager::GetSymbolVendorCreateCall
SymbolVendorCreateInstance
-PluginManager::GetSymbolVendorCreateCallbackForPluginName (const char *name)
+PluginManager::GetSymbolVendorCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetSymbolVendorMutex ());
SymbolVendorInstances &instances = GetSymbolVendorInstances ();
SymbolVendorInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
@@ -1747,7 +1730,7 @@ struct UnwindAssemblyInstance
{
}
- std::string name;
+ ConstString name;
std::string description;
UnwindAssemblyCreateInstance create_callback;
};
@@ -1771,7 +1754,7 @@ GetUnwindAssemblyInstances ()
bool
PluginManager::RegisterPlugin
(
- const char *name,
+ const ConstString &name,
const char *description,
UnwindAssemblyCreateInstance create_callback
)
@@ -1779,7 +1762,7 @@ PluginManager::RegisterPlugin
if (create_callback)
{
UnwindAssemblyInstance instance;
- assert (name && name[0]);
+ assert ((bool)name);
instance.name = name;
if (description && description[0])
instance.description = description;
@@ -1823,18 +1806,17 @@ PluginManager::GetUnwindAssemblyCreateCa
UnwindAssemblyCreateInstance
-PluginManager::GetUnwindAssemblyCreateCallbackForPluginName (const char *name)
+PluginManager::GetUnwindAssemblyCreateCallbackForPluginName (const ConstString &name)
{
- if (name && name[0])
+ if (name)
{
- llvm::StringRef name_sref(name);
Mutex::Locker locker (GetUnwindAssemblyMutex ());
UnwindAssemblyInstances &instances = GetUnwindAssemblyInstances ();
UnwindAssemblyInstances::iterator pos, end = instances.end();
for (pos = instances.begin(); pos != end; ++ pos)
{
- if (name_sref.equals (pos->name))
+ if (name == pos->name)
return pos->create_callback;
}
}
Modified: lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp Fri May 10 16:47:16 2013
@@ -38,7 +38,9 @@ OptionGroupPlatform::CreatePlatformWithO
{
if (platform_arch.IsValid() && !platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch))
{
- error.SetErrorStringWithFormat("platform '%s' doesn't support '%s'", platform_sp->GetName(), arch.GetTriple().getTriple().c_str());
+ error.SetErrorStringWithFormat ("platform '%s' doesn't support '%s'",
+ platform_sp->GetName().GetCString(),
+ arch.GetTriple().getTriple().c_str());
platform_sp.reset();
return platform_sp;
}
Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp Fri May 10 16:47:16 2013
@@ -35,12 +35,7 @@
using namespace lldb;
using namespace lldb_private;
-static const char *pluginName = "ABIMacOSX_arm";
-static const char *pluginDesc = "Mac OS X ABI for arm targets";
-static const char *pluginShort = "abi.macosx-arm";
-
-
-static RegisterInfo g_register_infos[] =
+static RegisterInfo g_register_infos[] =
{
// NAME ALT SZ OFF ENCODING FORMAT COMPILER DWARF GENERIC GDB LLDB NATIVE VALUE REGS INVALIDATE REGS
// ========== ======= == === ============= ============ ======================= =================== =========================== ======================= ====================== ========== ===============
@@ -841,8 +836,8 @@ ABIMacOSX_arm::RegisterIsVolatile (const
void
ABIMacOSX_arm::Initialize()
{
- PluginManager::RegisterPlugin (pluginName,
- pluginDesc,
+ PluginManager::RegisterPlugin (GetPluginNameStatic(),
+ "Mac OS X ABI for arm targets",
CreateInstance);
}
@@ -852,19 +847,20 @@ ABIMacOSX_arm::Terminate()
PluginManager::UnregisterPlugin (CreateInstance);
}
+lldb_private::ConstString
+ABIMacOSX_arm::GetPluginNameStatic()
+{
+ static ConstString g_name("macosx-arm");
+ return g_name;
+}
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ABIMacOSX_arm::GetPluginName()
{
- return pluginName;
-}
-
-const char *
-ABIMacOSX_arm::GetShortPluginName()
-{
- return pluginShort;
+ return GetPluginNameStatic();
}
uint32_t
Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h Fri May 10 16:47:16 2013
@@ -114,15 +114,15 @@ public:
static lldb::ABISP
CreateInstance (const lldb_private::ArchSpec &arch);
+ static lldb_private::ConstString
+ GetPluginNameStatic();
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Fri May 10 16:47:16 2013
@@ -30,10 +30,6 @@
using namespace lldb;
using namespace lldb_private;
-static const char *pluginName = "ABIMacOSX_i386";
-static const char *pluginDesc = "Mac OS X ABI for i386 targets";
-static const char *pluginShort = "abi.macosx-i386";
-
enum
{
gcc_eax = 0,
@@ -974,8 +970,8 @@ ABIMacOSX_i386::RegisterIsCalleeSaved (c
void
ABIMacOSX_i386::Initialize()
{
- PluginManager::RegisterPlugin (pluginName,
- pluginDesc,
+ PluginManager::RegisterPlugin (GetPluginNameStatic(),
+ "Mac OS X ABI for i386 targets",
CreateInstance);
}
@@ -985,19 +981,21 @@ ABIMacOSX_i386::Terminate()
PluginManager::UnregisterPlugin (CreateInstance);
}
+lldb_private::ConstString
+ABIMacOSX_i386::GetPluginNameStatic ()
+{
+ static ConstString g_short_name("abi.macosx-i386");
+ return g_short_name;
+
+}
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ABIMacOSX_i386::GetPluginName()
{
- return pluginName;
-}
-
-const char *
-ABIMacOSX_i386::GetShortPluginName()
-{
- return pluginShort;
+ return GetPluginNameStatic();
}
uint32_t
Modified: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h Fri May 10 16:47:16 2013
@@ -118,12 +118,12 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ static lldb_private::ConstString
+ GetPluginNameStatic ();
+
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Fri May 10 16:47:16 2013
@@ -33,11 +33,6 @@
using namespace lldb;
using namespace lldb_private;
-static const char *pluginName = "ABISysV_x86_64";
-static const char *pluginDesc = "System V ABI for x86_64 targets";
-static const char *pluginShort = "abi.sysv-x86_64";
-
-
enum gcc_dwarf_regnums
{
gcc_dwarf_rax = 0,
@@ -1269,8 +1264,8 @@ ABISysV_x86_64::RegisterIsCalleeSaved (c
void
ABISysV_x86_64::Initialize()
{
- PluginManager::RegisterPlugin (pluginName,
- pluginDesc,
+ PluginManager::RegisterPlugin (GetPluginNameStatic(),
+ "System V ABI for x86_64 targets",
CreateInstance);
}
@@ -1280,19 +1275,20 @@ ABISysV_x86_64::Terminate()
PluginManager::UnregisterPlugin (CreateInstance);
}
+lldb_private::ConstString
+ABISysV_x86_64::GetPluginNameStatic()
+{
+ static ConstString g_name("sysv-x86_64");
+ return g_name;
+}
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ABISysV_x86_64::GetPluginName()
{
- return pluginName;
-}
-
-const char *
-ABISysV_x86_64::GetShortPluginName()
-{
- return pluginShort;
+ return GetPluginNameStatic();
}
uint32_t
Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h Fri May 10 16:47:16 2013
@@ -112,15 +112,15 @@ public:
static lldb::ABISP
CreateInstance (const lldb_private::ArchSpec &arch);
+ static lldb_private::ConstString
+ GetPluginNameStatic();
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Fri May 10 16:47:16 2013
@@ -694,7 +694,7 @@ void
DisassemblerLLVMC::Initialize()
{
PluginManager::RegisterPlugin (GetPluginNameStatic(),
- GetPluginDescriptionStatic(),
+ "Disassembler that uses LLVM MC to disassemble i386, x86_64 and ARM.",
CreateInstance);
llvm::InitializeAllTargetInfos();
@@ -710,16 +710,11 @@ DisassemblerLLVMC::Terminate()
}
-const char *
+ConstString
DisassemblerLLVMC::GetPluginNameStatic()
{
- return "llvm-mc";
-}
-
-const char *
-DisassemblerLLVMC::GetPluginDescriptionStatic()
-{
- return "Disassembler that uses LLVM MC to disassemble i386, x86_64 and ARM.";
+ static ConstString g_name("llvm-mc");
+ return g_name;
}
int DisassemblerLLVMC::OpInfoCallback (void *disassembler,
@@ -813,15 +808,9 @@ const char *DisassemblerLLVMC::SymbolLoo
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+ConstString
DisassemblerLLVMC::GetPluginName()
{
- return "DisassemblerLLVMC";
-}
-
-const char *
-DisassemblerLLVMC::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h Fri May 10 16:47:16 2013
@@ -74,12 +74,9 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
- static const char *
- GetPluginDescriptionStatic();
-
static lldb_private::Disassembler *
CreateInstance(const lldb_private::ArchSpec &arch, const char *flavor);
@@ -99,12 +96,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Fri May 10 16:47:16 2013
@@ -26,7 +26,7 @@
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlanRunToAddress.h"
-
+#include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
#include "DynamicLoaderDarwinKernel.h"
@@ -460,7 +460,7 @@ DynamicLoaderDarwinKernel::DynamicLoader
m_mutex(Mutex::eMutexTypeRecursive),
m_break_id (LLDB_INVALID_BREAK_ID)
{
- PlatformSP platform_sp(Platform::FindPlugin (process, "darwin-kernel"));
+ PlatformSP platform_sp(Platform::FindPlugin (process, PlatformDarwinKernel::GetPluginNameStatic ()));
// Only select the darwin-kernel Platform if we've been asked to load kexts.
// It can take some time to scan over all of the kext info.plists and that
// shouldn't be done if kext loading is explicitly disabled.
@@ -811,8 +811,9 @@ DynamicLoaderDarwinKernel::KextImageInfo
PlatformSP platform_sp (target.GetPlatform());
if (platform_sp)
{
- const char *pname = platform_sp->GetShortPluginName();
- if (pname && strcmp (pname, "darwin-kernel") == 0)
+ ConstString platform_name (platform_sp->GetPluginName());
+ static ConstString g_platform_name (PlatformDarwinKernel::GetPluginNameStatic());
+ if (platform_name == g_platform_name)
{
ModuleSpec kext_bundle_module_spec(module_spec);
FileSpec kext_filespec(m_name.c_str(), false);
@@ -1594,10 +1595,11 @@ DynamicLoaderDarwinKernel::DebuggerIniti
}
}
-const char *
+lldb_private::ConstString
DynamicLoaderDarwinKernel::GetPluginNameStatic()
{
- return "dynamic-loader.darwin-kernel";
+ static ConstString g_name("darwin-kernel");
+ return g_name;
}
const char *
@@ -1610,15 +1612,9 @@ DynamicLoaderDarwinKernel::GetPluginDesc
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
DynamicLoaderDarwinKernel::GetPluginName()
{
- return "DynamicLoaderDarwinKernel";
-}
-
-const char *
-DynamicLoaderDarwinKernel::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h Fri May 10 16:47:16 2013
@@ -38,7 +38,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -80,12 +80,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Fri May 10 16:47:16 2013
@@ -1760,10 +1760,11 @@ DynamicLoaderMacOSXDYLD::Terminate()
}
-const char *
+lldb_private::ConstString
DynamicLoaderMacOSXDYLD::GetPluginNameStatic()
{
- return "dynamic-loader.macosx-dyld";
+ static ConstString g_name("macosx-dyld");
+ return g_name;
}
const char *
@@ -1776,15 +1777,9 @@ DynamicLoaderMacOSXDYLD::GetPluginDescri
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
DynamicLoaderMacOSXDYLD::GetPluginName()
{
- return "DynamicLoaderMacOSXDYLD";
-}
-
-const char *
-DynamicLoaderMacOSXDYLD::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h Fri May 10 16:47:16 2013
@@ -37,7 +37,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -80,12 +80,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Fri May 10 16:47:16 2013
@@ -40,22 +40,17 @@ DynamicLoaderPOSIXDYLD::Terminate()
{
}
-const char *
+lldb_private::ConstString
DynamicLoaderPOSIXDYLD::GetPluginName()
{
- return "DynamicLoaderPOSIXDYLD";
-}
-
-const char *
-DynamicLoaderPOSIXDYLD::GetShortPluginName()
-{
- return "linux-dyld";
+ return GetPluginNameStatic();
}
-const char *
+lldb_private::ConstString
DynamicLoaderPOSIXDYLD::GetPluginNameStatic()
{
- return "dynamic-loader.linux-dyld";
+ static ConstString g_name("linux-dyld");
+ return g_name;
}
const char *
Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h Fri May 10 16:47:16 2013
@@ -30,7 +30,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -64,12 +64,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp Fri May 10 16:47:16 2013
@@ -178,10 +178,11 @@ DynamicLoaderStatic::Terminate()
}
-const char *
+lldb_private::ConstString
DynamicLoaderStatic::GetPluginNameStatic()
{
- return "dynamic-loader.static";
+ static ConstString g_name("static");
+ return g_name;
}
const char *
@@ -194,15 +195,9 @@ DynamicLoaderStatic::GetPluginDescriptio
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
DynamicLoaderStatic::GetPluginName()
{
- return "DynamicLoaderStatic";
-}
-
-const char *
-DynamicLoaderStatic::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h Fri May 10 16:47:16 2013
@@ -37,7 +37,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -72,12 +72,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Fri May 10 16:47:16 2013
@@ -174,10 +174,11 @@ EmulateInstructionARM::Terminate ()
PluginManager::UnregisterPlugin (CreateInstance);
}
-const char *
+ConstString
EmulateInstructionARM::GetPluginNameStatic ()
{
- return "lldb.emulate-instruction.arm";
+ static ConstString g_name("arm");
+ return g_name;
}
const char *
Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h Fri May 10 16:47:16 2013
@@ -11,6 +11,7 @@
#define lldb_EmulateInstructionARM_h_
#include "lldb/Core/EmulateInstruction.h"
+#include "lldb/Core/ConstString.h"
#include "lldb/Core/Error.h"
#include "Plugins/Process/Utility/ARMDefines.h"
@@ -67,7 +68,7 @@ public:
static void
Terminate ();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic ();
static const char *
@@ -93,15 +94,9 @@ public:
return false;
}
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName()
{
- return "EmulateInstructionARM";
- }
-
- virtual const char *
- GetShortPluginName()
- {
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp Fri May 10 16:47:16 2013
@@ -32,9 +32,6 @@
using namespace lldb;
using namespace lldb_private;
-static const char *pluginName = "ItaniumABILanguageRuntime";
-static const char *pluginDesc = "Itanium ABI for the C++ language";
-static const char *pluginShort = "language.itanium";
static const char *vtable_demangled_prefix = "vtable for ";
bool
@@ -306,8 +303,8 @@ ItaniumABILanguageRuntime::CreateInstanc
void
ItaniumABILanguageRuntime::Initialize()
{
- PluginManager::RegisterPlugin (pluginName,
- pluginDesc,
+ PluginManager::RegisterPlugin (GetPluginNameStatic(),
+ "Itanium ABI for the C++ language",
CreateInstance);
}
@@ -317,19 +314,20 @@ ItaniumABILanguageRuntime::Terminate()
PluginManager::UnregisterPlugin (CreateInstance);
}
+lldb_private::ConstString
+ItaniumABILanguageRuntime::GetPluginNameStatic()
+{
+ static ConstString g_name("itanium");
+ return g_name;
+}
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ItaniumABILanguageRuntime::GetPluginName()
{
- return pluginName;
-}
-
-const char *
-ItaniumABILanguageRuntime::GetShortPluginName()
-{
- return pluginShort;
+ return GetPluginNameStatic();
}
uint32_t
Modified: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h Fri May 10 16:47:16 2013
@@ -52,15 +52,15 @@ namespace lldb_private {
static lldb_private::LanguageRuntime *
CreateInstance (Process *process, lldb::LanguageType language);
+ static lldb_private::ConstString
+ GetPluginNameStatic();
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp Fri May 10 16:47:16 2013
@@ -37,11 +37,6 @@
using namespace lldb;
using namespace lldb_private;
-static const char *pluginName = "AppleObjCRuntimeV1";
-static const char *pluginDesc = "Apple Objective C Language Runtime - Version 1";
-static const char *pluginShort = "language.apple.objc.v1";
-
-
AppleObjCRuntimeV1::AppleObjCRuntimeV1(Process *process) :
AppleObjCRuntime (process),
m_hash_signature (),
@@ -96,8 +91,8 @@ AppleObjCRuntimeV1::CreateInstance (Proc
void
AppleObjCRuntimeV1::Initialize()
{
- PluginManager::RegisterPlugin (pluginName,
- pluginDesc,
+ PluginManager::RegisterPlugin (GetPluginNameStatic(),
+ "Apple Objective C Language Runtime - Version 1",
CreateInstance);
}
@@ -107,19 +102,20 @@ AppleObjCRuntimeV1::Terminate()
PluginManager::UnregisterPlugin (CreateInstance);
}
+lldb_private::ConstString
+AppleObjCRuntimeV1::GetPluginNameStatic()
+{
+ static ConstString g_name("apple-objc-v1");
+ return g_name;
+}
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+ConstString
AppleObjCRuntimeV1::GetPluginName()
{
- return pluginName;
-}
-
-const char *
-AppleObjCRuntimeV1::GetShortPluginName()
-{
- return pluginShort;
+ return GetPluginNameStatic();
}
uint32_t
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h Fri May 10 16:47:16 2013
@@ -114,15 +114,15 @@ public:
static lldb_private::LanguageRuntime *
CreateInstance (Process *process, lldb::LanguageType language);
+ static lldb_private::ConstString
+ GetPluginNameStatic();
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Fri May 10 16:47:16 2013
@@ -50,10 +50,6 @@
using namespace lldb;
using namespace lldb_private;
-static const char *pluginName = "AppleObjCRuntimeV2";
-static const char *pluginDesc = "Apple Objective C Language Runtime - Version 2";
-static const char *pluginShort = "language.apple.objc.v2";
-
// 2 second timeout when running utility functions
#define UTILITY_FUNCTION_TIMEOUT_USEC 2*1000*1000
@@ -427,8 +423,8 @@ AppleObjCRuntimeV2::CreateInstance (Proc
void
AppleObjCRuntimeV2::Initialize()
{
- PluginManager::RegisterPlugin (pluginName,
- pluginDesc,
+ PluginManager::RegisterPlugin (GetPluginNameStatic(),
+ "Apple Objective C Language Runtime - Version 2",
CreateInstance);
}
@@ -438,19 +434,21 @@ AppleObjCRuntimeV2::Terminate()
PluginManager::UnregisterPlugin (CreateInstance);
}
+lldb_private::ConstString
+AppleObjCRuntimeV2::GetPluginNameStatic()
+{
+ static ConstString g_name("apple-objc-v2");
+ return g_name;
+}
+
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
AppleObjCRuntimeV2::GetPluginName()
{
- return pluginName;
-}
-
-const char *
-AppleObjCRuntimeV2::GetShortPluginName()
-{
- return pluginShort;
+ return GetPluginNameStatic();
}
uint32_t
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h Fri May 10 16:47:16 2013
@@ -55,15 +55,15 @@ public:
static lldb_private::LanguageRuntime *
CreateInstance (Process *process, lldb::LanguageType language);
+ static lldb_private::ConstString
+ GetPluginNameStatic();
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp Fri May 10 16:47:16 2013
@@ -148,11 +148,29 @@ ObjectContainerBSDArchive::Archive::Pars
}
ObjectContainerBSDArchive::Object *
-ObjectContainerBSDArchive::Archive::FindObject (const ConstString &object_name)
+ObjectContainerBSDArchive::Archive::FindObject (const ConstString &object_name, const TimeValue &object_mod_time)
{
const ObjectNameToIndexMap::Entry *match = m_object_name_to_index_map.FindFirstValueForName (object_name.GetCString());
if (match)
- return &m_objects[match->value];
+ {
+ if (object_mod_time.IsValid())
+ {
+ const uint64_t object_date = object_mod_time.GetAsSecondsSinceJan1_1970();
+ if (m_objects[match->value].ar_date == object_date)
+ return &m_objects[match->value];
+ const ObjectNameToIndexMap::Entry *next_match = m_object_name_to_index_map.FindNextValueForName (match);
+ while (next_match)
+ {
+ if (m_objects[next_match->value].ar_date == object_date)
+ return &m_objects[next_match->value];
+ next_match = m_object_name_to_index_map.FindNextValueForName (next_match);
+ }
+ }
+ else
+ {
+ return &m_objects[match->value];
+ }
+ }
return NULL;
}
@@ -250,10 +268,11 @@ ObjectContainerBSDArchive::Terminate()
}
-const char *
+lldb_private::ConstString
ObjectContainerBSDArchive::GetPluginNameStatic()
{
- return "object-container.bsd-archive";
+ static ConstString g_name("bsd-archive");
+ return g_name;
}
const char *
@@ -297,11 +316,11 @@ ObjectContainerBSDArchive::CreateInstanc
Archive::shared_ptr archive_sp (Archive::FindCachedArchive (*file, module_sp->GetArchitecture(), module_sp->GetModificationTime()));
std::unique_ptr<ObjectContainerBSDArchive> container_ap(new ObjectContainerBSDArchive (module_sp,
- archive_data_sp,
- archive_data_offset,
- file,
- file_offset,
- length));
+ archive_data_sp,
+ archive_data_offset,
+ file,
+ file_offset,
+ length));
if (container_ap.get())
{
@@ -434,7 +453,8 @@ ObjectContainerBSDArchive::GetObjectFile
{
if (module_sp->GetObjectName() && m_archive_sp)
{
- Object *object = m_archive_sp->FindObject (module_sp->GetObjectName());
+ Object *object = m_archive_sp->FindObject (module_sp->GetObjectName(),
+ module_sp->GetObjectModificationTime());
if (object)
{
lldb::offset_t data_offset = m_offset + object->ar_file_offset;
@@ -454,15 +474,9 @@ ObjectContainerBSDArchive::GetObjectFile
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ObjectContainerBSDArchive::GetPluginName()
{
- return "object-container.bsd-archive";
-}
-
-const char *
-ObjectContainerBSDArchive::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h Fri May 10 16:47:16 2013
@@ -32,7 +32,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -89,12 +89,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
@@ -163,7 +160,8 @@ protected:
ParseObjects ();
Object *
- FindObject (const lldb_private::ConstString &object_name);
+ FindObject (const lldb_private::ConstString &object_name,
+ const lldb_private::TimeValue &object_mod_time);
const lldb_private::TimeValue &
GetModificationTime()
Modified: lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp Fri May 10 16:47:16 2013
@@ -37,10 +37,11 @@ ObjectContainerUniversalMachO::Terminate
}
-const char *
+lldb_private::ConstString
ObjectContainerUniversalMachO::GetPluginNameStatic()
{
- return "object-container.mach-o";
+ static ConstString g_name("mach-o");
+ return g_name;
}
const char *
@@ -259,15 +260,9 @@ ObjectContainerUniversalMachO::GetObject
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ObjectContainerUniversalMachO::GetPluginName()
{
- return "ObjectContainerUniversalMachO";
-}
-
-const char *
-ObjectContainerUniversalMachO::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h Fri May 10 16:47:16 2013
@@ -28,7 +28,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -84,12 +84,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Fri May 10 16:47:16 2013
@@ -160,10 +160,11 @@ ObjectFileELF::Terminate()
PluginManager::UnregisterPlugin(CreateInstance);
}
-const char *
+lldb_private::ConstString
ObjectFileELF::GetPluginNameStatic()
{
- return "object-file.elf";
+ static ConstString g_name("elf");
+ return g_name;
}
const char *
@@ -236,15 +237,9 @@ ObjectFileELF::GetModuleSpecifications (
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ObjectFileELF::GetPluginName()
{
- return "ObjectFileELF";
-}
-
-const char *
-ObjectFileELF::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h Fri May 10 16:47:16 2013
@@ -38,7 +38,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -68,12 +68,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Fri May 10 16:47:16 2013
@@ -379,10 +379,11 @@ ObjectFileMachO::Terminate()
}
-const char *
+lldb_private::ConstString
ObjectFileMachO::GetPluginNameStatic()
{
- return "object-file.mach-o";
+ static ConstString g_name("mach-o");
+ return g_name;
}
const char *
@@ -4169,15 +4170,9 @@ ObjectFileMachO::GetLLDBSharedCacheUUID
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ObjectFileMachO::GetPluginName()
{
- return "ObjectFileMachO";
-}
-
-const char *
-ObjectFileMachO::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h Fri May 10 16:47:16 2013
@@ -35,7 +35,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -122,12 +122,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Fri May 10 16:47:16 2013
@@ -133,10 +133,11 @@ ObjectFilePECOFF::Terminate()
}
-const char *
+lldb_private::ConstString
ObjectFilePECOFF::GetPluginNameStatic()
{
- return "object-file.pe-coff";
+ static ConstString g_name("pe-coff");
+ return g_name;
}
const char *
@@ -954,15 +955,9 @@ ObjectFilePECOFF::CalculateStrata()
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+ConstString
ObjectFilePECOFF::GetPluginName()
{
- return "ObjectFilePECOFF";
-}
-
-const char *
-ObjectFilePECOFF::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h (original)
+++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h Fri May 10 16:47:16 2013
@@ -28,7 +28,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -106,12 +106,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
//
Modified: lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp (original)
+++ lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp Fri May 10 16:47:16 2013
@@ -69,10 +69,11 @@ OperatingSystemPython::CreateInstance (P
}
-const char *
+ConstString
OperatingSystemPython::GetPluginNameStatic()
{
- return "python";
+ static ConstString g_name("python");
+ return g_name;
}
const char *
@@ -152,15 +153,9 @@ OperatingSystemPython::GetDynamicRegiste
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+ConstString
OperatingSystemPython::GetPluginName()
{
- return "OperatingSystemPython";
-}
-
-const char *
-OperatingSystemPython::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h (original)
+++ lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h Fri May 10 16:47:16 2013
@@ -34,7 +34,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -52,12 +52,9 @@ public:
//------------------------------------------------------------------
// lldb_private::PluginInterface Methods
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Fri May 10 16:47:16 2013
@@ -85,19 +85,19 @@ PlatformFreeBSD::CreateInstance (bool fo
}
-const char *
-PlatformFreeBSD::GetPluginNameStatic()
-{
- return "plugin.platform.freebsd";
-}
-
-const char *
-PlatformFreeBSD::GetShortPluginNameStatic (bool is_host)
+lldb_private::ConstString
+PlatformFreeBSD::GetPluginNameStatic (bool is_host)
{
if (is_host)
- return Platform::GetHostPlatformName ();
+ {
+ static ConstString g_host_name(Platform::GetHostPlatformName ());
+ return g_host_name;
+ }
else
- return "remote-freebsd";
+ {
+ static ConstString g_remote_name("remote-freebsd");
+ return g_remote_name;
+ }
}
const char *
@@ -122,7 +122,7 @@ PlatformFreeBSD::Initialize ()
default_platform_sp->SetSystemArchitecture (Host::GetArchitecture());
Platform::SetDefaultPlatform (default_platform_sp);
#endif
- PluginManager::RegisterPlugin(PlatformFreeBSD::GetShortPluginNameStatic(false),
+ PluginManager::RegisterPlugin(PlatformFreeBSD::GetPluginNameStatic(false),
PlatformFreeBSD::GetDescriptionStatic(false),
PlatformFreeBSD::CreateInstance);
}
@@ -269,7 +269,7 @@ PlatformFreeBSD::ResolveExecutable (cons
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
- GetShortPluginName(),
+ GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
}
@@ -377,7 +377,7 @@ PlatformFreeBSD::ConnectRemote (Args& ar
Error error;
if (IsHost())
{
- error.SetErrorStringWithFormat ("can't connect to the host platform '%s', always connected", GetShortPluginName());
+ error.SetErrorStringWithFormat ("can't connect to the host platform '%s', always connected", GetPluginName().GetCString());
}
else
{
@@ -415,7 +415,7 @@ PlatformFreeBSD::DisconnectRemote ()
if (IsHost())
{
- error.SetErrorStringWithFormat ("can't disconnect from the host platform '%s', always connected", GetShortPluginName());
+ error.SetErrorStringWithFormat ("can't disconnect from the host platform '%s', always connected", GetPluginName().GetCString());
}
else
{
Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h Fri May 10 16:47:16 2013
@@ -33,14 +33,11 @@ public:
static void
Terminate ();
- static const char *
- GetPluginNameStatic();
-
- static const char *
- GetShortPluginNameStatic(bool is_host);
+ static lldb_private::ConstString
+ GetPluginNameStatic (bool is_host);
static const char *
- GetDescriptionStatic(bool is_host);
+ GetDescriptionStatic (bool is_host);
//------------------------------------------------------------
// Class Methods
@@ -53,16 +50,10 @@ public:
//------------------------------------------------------------
// lldb_private::PluginInterface functions
//------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName()
{
- return GetPluginNameStatic();
- }
-
- virtual const char *
- GetShortPluginName()
- {
- return GetShortPluginNameStatic (IsHost());
+ return GetPluginNameStatic (IsHost());
}
virtual uint32_t
Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Fri May 10 16:47:16 2013
@@ -86,19 +86,20 @@ PlatformLinux::CreateInstance (bool forc
return NULL;
}
-const char *
-PlatformLinux::GetPluginNameStatic()
-{
- return "plugin.platform.linux";
-}
-const char *
-PlatformLinux::GetShortPluginNameStatic (bool is_host)
+lldb_private::ConstString
+PlatformLinux::GetPluginNameStatic (bool is_host)
{
if (is_host)
- return Platform::GetHostPlatformName ();
+ {
+ static ConstString g_host_name(Platform::GetHostPlatformName ());
+ return g_host_name;
+ }
else
- return "remote-linux";
+ {
+ static ConstString g_remote_name("remote-linux");
+ return g_remote_name;
+ }
}
const char *
@@ -110,6 +111,12 @@ PlatformLinux::GetPluginDescriptionStati
return "Remote Linux user platform plug-in.";
}
+lldb_private::ConstString
+PlatformLinux::GetPluginName()
+{
+ return GetPluginNameStatic(IsHost());
+}
+
void
PlatformLinux::Initialize ()
{
@@ -120,7 +127,7 @@ PlatformLinux::Initialize ()
default_platform_sp->SetSystemArchitecture (Host::GetArchitecture());
Platform::SetDefaultPlatform (default_platform_sp);
#endif
- PluginManager::RegisterPlugin(PlatformLinux::GetShortPluginNameStatic(false),
+ PluginManager::RegisterPlugin(PlatformLinux::GetPluginNameStatic(false),
PlatformLinux::GetPluginDescriptionStatic(false),
PlatformLinux::CreateInstance);
}
@@ -242,7 +249,7 @@ PlatformLinux::ResolveExecutable (const
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
- GetShortPluginName(),
+ GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
}
Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Fri May 10 16:47:16 2013
@@ -39,26 +39,14 @@ namespace lldb_private {
static Platform *
CreateInstance (bool force, const lldb_private::ArchSpec *arch);
- static const char *
- GetPluginNameStatic();
-
- static const char *
- GetShortPluginNameStatic(bool is_host);
+ static lldb_private::ConstString
+ GetPluginNameStatic (bool is_host);
static const char *
- GetPluginDescriptionStatic(bool is_host);
+ GetPluginDescriptionStatic (bool is_host);
- virtual const char *
- GetPluginName()
- {
- return GetPluginNameStatic();
- }
-
- virtual const char *
- GetShortPluginName()
- {
- return "PlatformLinux";
- }
+ virtual lldb_private::ConstString
+ GetPluginName();
virtual uint32_t
GetPluginVersion()
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Fri May 10 16:47:16 2013
@@ -232,7 +232,7 @@ PlatformDarwin::ResolveExecutable (const
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
- GetShortPluginName(),
+ GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
}
@@ -501,7 +501,7 @@ PlatformDarwin::ConnectRemote (Args& arg
Error error;
if (IsHost())
{
- error.SetErrorStringWithFormat ("can't connect to the host platform '%s', always connected", GetShortPluginName());
+ error.SetErrorStringWithFormat ("can't connect to the host platform '%s', always connected", GetPluginName().GetCString());
}
else
{
@@ -539,7 +539,7 @@ PlatformDarwin::DisconnectRemote ()
if (IsHost())
{
- error.SetErrorStringWithFormat ("can't disconnect from the host platform '%s', always connected", GetShortPluginName());
+ error.SetErrorStringWithFormat ("can't disconnect from the host platform '%s', always connected", GetPluginName().GetCString());
}
else
{
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Fri May 10 16:47:16 2013
@@ -53,7 +53,7 @@ PlatformDarwinKernel::Initialize ()
{
if (g_initialize_count++ == 0)
{
- PluginManager::RegisterPlugin (PlatformDarwinKernel::GetShortPluginNameStatic(),
+ PluginManager::RegisterPlugin (PlatformDarwinKernel::GetPluginNameStatic(),
PlatformDarwinKernel::GetDescriptionStatic(),
PlatformDarwinKernel::CreateInstance,
PlatformDarwinKernel::DebuggerInitialize);
@@ -147,16 +147,11 @@ PlatformDarwinKernel::CreateInstance (bo
}
-const char *
+lldb_private::ConstString
PlatformDarwinKernel::GetPluginNameStatic ()
{
- return "PlatformDarwinKernel";
-}
-
-const char *
-PlatformDarwinKernel::GetShortPluginNameStatic()
-{
- return "darwin-kernel";
+ static ConstString g_name("darwin-kernel");
+ return g_name;
}
const char *
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h Fri May 10 16:47:16 2013
@@ -40,13 +40,10 @@ public:
static void
Terminate ();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic ();
static const char *
- GetShortPluginNameStatic();
-
- static const char *
GetDescriptionStatic();
//------------------------------------------------------------
@@ -60,18 +57,12 @@ public:
//------------------------------------------------------------
// lldb_private::PluginInterface functions
//------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName()
{
return GetPluginNameStatic();
}
- virtual const char *
- GetShortPluginName()
- {
- return GetShortPluginNameStatic();
- }
-
virtual uint32_t
GetPluginVersion()
{
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Fri May 10 16:47:16 2013
@@ -41,7 +41,7 @@ PlatformMacOSX::Initialize ()
default_platform_sp->SetSystemArchitecture (Host::GetArchitecture());
Platform::SetDefaultPlatform (default_platform_sp);
#endif
- PluginManager::RegisterPlugin (PlatformMacOSX::GetShortPluginNameStatic(false),
+ PluginManager::RegisterPlugin (PlatformMacOSX::GetPluginNameStatic(false),
PlatformMacOSX::GetDescriptionStatic(false),
PlatformMacOSX::CreateInstance);
}
@@ -115,20 +115,19 @@ PlatformMacOSX::CreateInstance (bool for
return NULL;
}
-
-const char *
-PlatformMacOSX::GetPluginNameStatic ()
-{
- return "PlatformMacOSX";
-}
-
-const char *
-PlatformMacOSX::GetShortPluginNameStatic (bool is_host)
+lldb_private::ConstString
+PlatformMacOSX::GetPluginNameStatic (bool is_host)
{
if (is_host)
- return Platform::GetHostPlatformName ();
+ {
+ static ConstString g_host_name(Platform::GetHostPlatformName ());
+ return g_host_name;
+ }
else
- return "remote-macosx";
+ {
+ static ConstString g_remote_name("remote-macosx");
+ return g_remote_name;
+ }
}
const char *
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.h Fri May 10 16:47:16 2013
@@ -32,11 +32,8 @@ public:
static void
Terminate ();
- static const char *
- GetPluginNameStatic ();
-
- static const char *
- GetShortPluginNameStatic(bool is_host);
+ static lldb_private::ConstString
+ GetPluginNameStatic (bool is_host);
static const char *
GetDescriptionStatic(bool is_host);
@@ -52,16 +49,10 @@ public:
//------------------------------------------------------------
// lldb_private::PluginInterface functions
//------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName()
{
- return GetPluginNameStatic ();
- }
-
- virtual const char *
- GetShortPluginName()
- {
- return GetShortPluginNameStatic (IsHost());
+ return GetPluginNameStatic (IsHost());
}
virtual uint32_t
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Fri May 10 16:47:16 2013
@@ -65,7 +65,7 @@ PlatformRemoteiOS::Initialize ()
{
if (g_initialize_count++ == 0)
{
- PluginManager::RegisterPlugin (PlatformRemoteiOS::GetShortPluginNameStatic(),
+ PluginManager::RegisterPlugin (PlatformRemoteiOS::GetPluginNameStatic(),
PlatformRemoteiOS::GetDescriptionStatic(),
PlatformRemoteiOS::CreateInstance);
}
@@ -148,16 +148,11 @@ PlatformRemoteiOS::CreateInstance (bool
}
-const char *
+lldb_private::ConstString
PlatformRemoteiOS::GetPluginNameStatic ()
{
- return "PlatformRemoteiOS";
-}
-
-const char *
-PlatformRemoteiOS::GetShortPluginNameStatic()
-{
- return "remote-ios";
+ static ConstString g_name("remote-ios");
+ return g_name;
}
const char *
@@ -279,7 +274,7 @@ PlatformRemoteiOS::ResolveExecutable (co
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
- GetShortPluginName(),
+ GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
}
@@ -661,7 +656,7 @@ PlatformRemoteiOS::GetSymbolFile (const
error.SetErrorStringWithFormat ("unable to locate a platform file for '%s' in platform '%s'",
platform_file_path,
- GetPluginName());
+ GetPluginName().GetCString());
}
else
{
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h Fri May 10 16:47:16 2013
@@ -34,13 +34,10 @@ public:
static void
Terminate ();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic ();
static const char *
- GetShortPluginNameStatic();
-
- static const char *
GetDescriptionStatic();
//------------------------------------------------------------
@@ -54,18 +51,12 @@ public:
//------------------------------------------------------------
// lldb_private::PluginInterface functions
//------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName()
{
return GetPluginNameStatic();
}
- virtual const char *
- GetShortPluginName()
- {
- return GetShortPluginNameStatic();
- }
-
virtual uint32_t
GetPluginVersion()
{
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp Fri May 10 16:47:16 2013
@@ -42,7 +42,7 @@ PlatformiOSSimulator::Initialize ()
{
if (g_initialize_count++ == 0)
{
- PluginManager::RegisterPlugin (PlatformiOSSimulator::GetShortPluginNameStatic(),
+ PluginManager::RegisterPlugin (PlatformiOSSimulator::GetPluginNameStatic(),
PlatformiOSSimulator::GetDescriptionStatic(),
PlatformiOSSimulator::CreateInstance);
}
@@ -124,16 +124,11 @@ PlatformiOSSimulator::CreateInstance (bo
}
-const char *
+lldb_private::ConstString
PlatformiOSSimulator::GetPluginNameStatic ()
{
- return "PlatformiOSSimulator";
-}
-
-const char *
-PlatformiOSSimulator::GetShortPluginNameStatic()
-{
- return "ios-simulator";
+ static ConstString g_name("ios-simulator");
+ return g_name;
}
const char *
@@ -242,7 +237,7 @@ PlatformiOSSimulator::ResolveExecutable
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
- GetShortPluginName(),
+ GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
}
@@ -352,7 +347,7 @@ PlatformiOSSimulator::GetFile (const Fil
}
error.SetErrorStringWithFormat ("unable to locate a platform file for '%s' in platform '%s'",
platform_file_path,
- GetPluginName());
+ GetPluginName().GetCString());
}
else
{
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h Fri May 10 16:47:16 2013
@@ -32,13 +32,10 @@ public:
static void
Terminate ();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic ();
static const char *
- GetShortPluginNameStatic();
-
- static const char *
GetDescriptionStatic();
//------------------------------------------------------------
@@ -52,18 +49,12 @@ public:
//------------------------------------------------------------
// lldb_private::PluginInterface functions
//------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName()
{
return GetPluginNameStatic();
}
- virtual const char *
- GetShortPluginName()
- {
- return GetShortPluginNameStatic();
- }
-
virtual uint32_t
GetPluginVersion()
{
Modified: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Fri May 10 16:47:16 2013
@@ -41,7 +41,7 @@ PlatformRemoteGDBServer::Initialize ()
if (g_initialized == false)
{
g_initialized = true;
- PluginManager::RegisterPlugin (PlatformRemoteGDBServer::GetShortPluginNameStatic(),
+ PluginManager::RegisterPlugin (PlatformRemoteGDBServer::GetPluginNameStatic(),
PlatformRemoteGDBServer::GetDescriptionStatic(),
PlatformRemoteGDBServer::CreateInstance);
}
@@ -71,10 +71,11 @@ PlatformRemoteGDBServer::CreateInstance
}
-const char *
-PlatformRemoteGDBServer::GetShortPluginNameStatic()
+lldb_private::ConstString
+PlatformRemoteGDBServer::GetPluginNameStatic()
{
- return "remote-gdb-server";
+ static ConstString g_name("remote-gdb-server");
+ return g_name;
}
const char *
Modified: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h (original)
+++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h Fri May 10 16:47:16 2013
@@ -32,8 +32,8 @@ public:
static lldb_private::Platform*
CreateInstance (bool force, const lldb_private::ArchSpec *arch);
- static const char *
- GetShortPluginNameStatic();
+ static lldb_private::ConstString
+ GetPluginNameStatic();
static const char *
GetDescriptionStatic();
@@ -47,16 +47,10 @@ public:
//------------------------------------------------------------
// lldb_private::PluginInterface functions
//------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName()
{
- return "PlatformRemoteGDBServer";
- }
-
- virtual const char *
- GetShortPluginName()
- {
- return GetShortPluginNameStatic();
+ return GetPluginNameStatic();
}
virtual uint32_t
Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp Fri May 10 16:47:16 2013
@@ -64,10 +64,11 @@ ProcessFreeBSD::Initialize()
}
}
-const char *
+lldb_private::ConstString
ProcessFreeBSD::GetPluginNameStatic()
{
- return "freebsd";
+ static ConstString g_name("freebsd");
+ return g_name;
}
const char *
@@ -79,16 +80,10 @@ ProcessFreeBSD::GetPluginDescriptionStat
//------------------------------------------------------------------------------
// ProcessInterface protocol.
-const char *
+lldb_private::ConstString
ProcessFreeBSD::GetPluginName()
{
- return "process.freebsd";
-}
-
-const char *
-ProcessFreeBSD::GetShortPluginName()
-{
- return "process.freebsd";
+ return GetPluginNameStatic();
}
uint32_t
Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h Fri May 10 16:47:16 2013
@@ -42,7 +42,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -60,12 +60,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp Fri May 10 16:47:16 2013
@@ -81,10 +81,11 @@ void
ProcessLinux::Terminate()
{
}
-const char *
+lldb_private::ConstString
ProcessLinux::GetPluginNameStatic()
{
- return "linux";
+ static ConstString g_name("linux");
+ return g_name;
}
const char *
@@ -105,16 +106,10 @@ ProcessLinux::UpdateThreadList(ThreadLis
//------------------------------------------------------------------------------
// ProcessInterface protocol.
-const char *
+lldb_private::ConstString
ProcessLinux::GetPluginName()
{
- return "process.linux";
-}
-
-const char *
-ProcessLinux::GetShortPluginName()
-{
- return "process.linux";
+ return GetPluginNameStatic();
}
uint32_t
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h Fri May 10 16:47:16 2013
@@ -41,7 +41,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -58,12 +58,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp Fri May 10 16:47:16 2013
@@ -46,10 +46,11 @@ using namespace lldb_private;
static const lldb::tid_t g_kernel_tid = 1;
-const char *
+ConstString
ProcessKDP::GetPluginNameStatic()
{
- return "kdp-remote";
+ static ConstString g_name("kdp-remote");
+ return g_name;
}
const char *
@@ -141,15 +142,9 @@ ProcessKDP::~ProcessKDP()
//----------------------------------------------------------------------
// PluginInterface
//----------------------------------------------------------------------
-const char *
+lldb_private::ConstString
ProcessKDP::GetPluginName()
{
- return "Process debugging plug-in that uses the Darwin KDP remote protocol";
-}
-
-const char *
-ProcessKDP::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h Fri May 10 16:47:16 2013
@@ -49,7 +49,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -113,12 +113,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.cpp Fri May 10 16:47:16 2013
@@ -167,7 +167,8 @@ ProcessKDPLog::ListLogCategories (Stream
" thread - log thread events and activities\n"
" step - log step related activities\n"
" verbose - enable verbose logging\n"
- " watch - log watchpoint related activities\n", ProcessKDP::GetPluginNameStatic());
+ " watch - log watchpoint related activities\n",
+ ProcessKDP::GetPluginNameStatic().GetCString());
}
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Fri May 10 16:47:16 2013
@@ -116,10 +116,11 @@ get_random_port ()
}
-const char *
+lldb_private::ConstString
ProcessGDBRemote::GetPluginNameStatic()
{
- return "gdb-remote";
+ static ConstString g_name("gdb-remote");
+ return g_name;
}
const char *
@@ -233,15 +234,9 @@ ProcessGDBRemote::~ProcessGDBRemote()
//----------------------------------------------------------------------
// PluginInterface
//----------------------------------------------------------------------
-const char *
+ConstString
ProcessGDBRemote::GetPluginName()
{
- return "Process debugging plug-in that uses the GDB remote protocol";
-}
-
-const char *
-ProcessGDBRemote::GetShortPluginName()
-{
return GetPluginNameStatic();
}
@@ -1746,7 +1741,7 @@ ProcessGDBRemote::DoDestroy ()
// FIXME: These should be ConstStrings so we aren't doing strcmp'ing.
if (platform_sp
&& platform_sp->GetName()
- && strcmp (platform_sp->GetName(), PlatformRemoteiOS::GetShortPluginNameStatic()) == 0)
+ && platform_sp->GetName() == PlatformRemoteiOS::GetPluginNameStatic())
{
if (m_destroy_tried_resuming)
{
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Fri May 10 16:47:16 2013
@@ -50,7 +50,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -119,12 +119,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp Fri May 10 16:47:16 2013
@@ -178,7 +178,7 @@ ProcessGDBRemoteLog::ListLogCategories (
" thread - log thread events and activities\n"
" step - log step related activities\n"
" verbose - enable verbose logging\n"
- " watch - log watchpoint related activities\n", ProcessGDBRemote::GetPluginNameStatic());
+ " watch - log watchpoint related activities\n", ProcessGDBRemote::GetPluginNameStatic().GetCString());
}
Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Fri May 10 16:47:16 2013
@@ -38,10 +38,11 @@
using namespace lldb;
using namespace lldb_private;
-const char *
+ConstString
ProcessMachCore::GetPluginNameStatic()
{
- return "mach-o-core";
+ static ConstString g_name("mach-o-core");
+ return g_name;
}
const char *
@@ -125,15 +126,9 @@ ProcessMachCore::~ProcessMachCore()
//----------------------------------------------------------------------
// PluginInterface
//----------------------------------------------------------------------
-const char *
+ConstString
ProcessMachCore::GetPluginName()
{
- return "Process debugging plug-in that loads mach-o core files.";
-}
-
-const char *
-ProcessMachCore::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h Fri May 10 16:47:16 2013
@@ -39,7 +39,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -74,12 +74,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp Fri May 10 16:47:16 2013
@@ -51,7 +51,7 @@ LogChannelDWARF::CreateInstance ()
return new LogChannelDWARF ();
}
-const char *
+lldb_private::ConstString
LogChannelDWARF::GetPluginNameStatic()
{
return SymbolFileDWARF::GetPluginNameStatic();
@@ -63,15 +63,9 @@ LogChannelDWARF::GetPluginDescriptionSta
return "DWARF log channel for debugging plug-in issues.";
}
-const char *
+lldb_private::ConstString
LogChannelDWARF::GetPluginName()
{
- return GetPluginDescriptionStatic();
-}
-
-const char *
-LogChannelDWARF::GetShortPluginName()
-{
return GetPluginNameStatic();
}
@@ -187,7 +181,7 @@ LogChannelDWARF::ListCategories (Stream
" lookups - log any lookups that happen by name, regex, or address\n"
" completion - log struct/unions/class type completions\n"
" map - log insertions of object files into DWARF debug maps\n",
- SymbolFileDWARF::GetPluginNameStatic());
+ SymbolFileDWARF::GetPluginNameStatic().GetCString());
}
Log *
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h Fri May 10 16:47:16 2013
@@ -43,7 +43,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -52,12 +52,9 @@ public:
static lldb_private::LogChannel *
CreateInstance ();
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri May 10 16:47:16 2013
@@ -207,10 +207,11 @@ SymbolFileDWARF::Terminate()
}
-const char *
+lldb_private::ConstString
SymbolFileDWARF::GetPluginNameStatic()
{
- return "dwarf";
+ static ConstString g_name("dwarf");
+ return g_name;
}
const char *
@@ -7557,15 +7558,9 @@ SymbolFileDWARF::ParseVariables
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+ConstString
SymbolFileDWARF::GetPluginName()
{
- return "SymbolFileDWARF";
-}
-
-const char *
-SymbolFileDWARF::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Fri May 10 16:47:16 2013
@@ -74,7 +74,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -181,12 +181,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Fri May 10 16:47:16 2013
@@ -179,8 +179,9 @@ public:
const FileSpec& file_spec,
const ArchSpec& arch,
const ConstString *object_name,
- off_t object_offset) :
- Module (file_spec, arch, object_name, object_offset),
+ off_t object_offset,
+ const TimeValue *object_mod_time_ptr) :
+ Module (file_spec, arch, object_name, object_offset, object_mod_time_ptr),
m_exe_module_wp (exe_module_sp),
m_cu_idx (cu_idx)
{
@@ -213,7 +214,7 @@ public:
// Set a a pointer to this class to set our OSO DWARF file know
// that the DWARF is being used along with a debug map and that
// it will have the remapped sections that we do below.
- SymbolFileDWARF *oso_symfile = (SymbolFileDWARF *)symbol_vendor->GetSymbolFile();
+ SymbolFileDWARF *oso_symfile = SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF(symbol_vendor->GetSymbolFile());
if (!oso_symfile)
return NULL;
@@ -263,10 +264,11 @@ SymbolFileDWARFDebugMap::Terminate()
}
-const char *
+lldb_private::ConstString
SymbolFileDWARFDebugMap::GetPluginNameStatic()
{
- return "dwarf-debugmap";
+ static ConstString g_name("dwarf-debugmap");
+ return g_name;
}
const char *
@@ -381,6 +383,9 @@ SymbolFileDWARFDebugMap::InitOSO()
{
m_compile_unit_infos[i].so_file.SetFile(so_symbol->GetName().AsCString(), false);
m_compile_unit_infos[i].oso_path = oso_symbol->GetName();
+ TimeValue oso_mod_time;
+ oso_mod_time.OffsetWithSeconds(oso_symbol->GetAddress().GetOffset());
+ m_compile_unit_infos[i].oso_mod_time = oso_mod_time;
uint32_t sibling_idx = so_symbol->GetSiblingIndex();
// The sibling index can't be less that or equal to the current index "i"
if (sibling_idx <= i)
@@ -436,12 +441,26 @@ SymbolFileDWARFDebugMap::GetModuleByComp
}
else
{
+ ObjectFile *obj_file = GetObjectFile();
comp_unit_info->oso_sp.reset (new OSOInfo());
m_oso_map[comp_unit_info->oso_path] = comp_unit_info->oso_sp;
const char *oso_path = comp_unit_info->oso_path.GetCString();
FileSpec oso_file (oso_path, false);
ConstString oso_object;
- if (!oso_file.Exists())
+ if (oso_file.Exists())
+ {
+ TimeValue oso_mod_time (oso_file.GetModificationTime());
+ if (oso_mod_time != comp_unit_info->oso_mod_time)
+ {
+ obj_file->GetModule()->ReportError ("debug map object file '%s' has changed (actual time is 0x%" PRIx64 ", debug map time is 0x%" PRIx64 ") since this executable was linked, file will be ignored",
+ oso_file.GetPath().c_str(),
+ oso_mod_time.GetAsSecondsSinceJan1_1970(),
+ comp_unit_info->oso_mod_time.GetAsSecondsSinceJan1_1970());
+ return NULL;
+ }
+
+ }
+ else
{
const bool must_exist = true;
@@ -450,7 +469,6 @@ SymbolFileDWARFDebugMap::GetModuleByComp
oso_object,
must_exist))
{
- comp_unit_info->oso_sp->symbol_file_supported = false;
return NULL;
}
}
@@ -458,12 +476,13 @@ SymbolFileDWARFDebugMap::GetModuleByComp
// use the debug map, to add new sections to each .o file and
// even though a .o file might not have changed, the sections
// that get added to the .o file can change.
- comp_unit_info->oso_sp->module_sp.reset (new DebugMapModule (GetObjectFile()->GetModule(),
+ comp_unit_info->oso_sp->module_sp.reset (new DebugMapModule (obj_file->GetModule(),
GetCompUnitInfoIndex(comp_unit_info),
oso_file,
m_obj_file->GetModule()->GetArchitecture(),
oso_object ? &oso_object : NULL,
- 0));
+ 0,
+ oso_object ? &comp_unit_info->oso_mod_time : NULL));
}
}
if (comp_unit_info->oso_sp)
@@ -538,6 +557,14 @@ SymbolFileDWARFDebugMap::GetSymbolFileBy
}
SymbolFileDWARF *
+SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF (SymbolFile *sym_file)
+{
+ if (sym_file && sym_file->GetPluginName() == SymbolFileDWARF::GetPluginNameStatic())
+ return (SymbolFileDWARF *)sym_file;
+ return NULL;
+}
+
+SymbolFileDWARF *
SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit_info)
{
Module *oso_module = GetModuleByCompUnitInfo (comp_unit_info);
@@ -545,7 +572,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileBy
{
SymbolVendor *sym_vendor = oso_module->GetSymbolVendor();
if (sym_vendor)
- return (SymbolFileDWARF *)sym_vendor->GetSymbolFile();
+ return GetSymbolFileAsSymbolFileDWARF (sym_vendor->GetSymbolFile());
}
return NULL;
}
@@ -1219,15 +1246,9 @@ SymbolFileDWARFDebugMap::FindNamespace (
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
SymbolFileDWARFDebugMap::GetPluginName()
{
- return "SymbolFileDWARFDebugMap";
-}
-
-const char *
-SymbolFileDWARFDebugMap::GetShortPluginName()
-{
return GetPluginNameStatic();
}
@@ -1454,7 +1475,7 @@ SymbolFileDWARFDebugMap::LinkOSOAddress
if (addr_module == exe_module)
return true; // Address is already in terms of the main executable module
- CompileUnitInfo *cu_info = GetCompileUnitInfo ((SymbolFileDWARF *)addr_module->GetSymbolVendor()->GetSymbolFile());
+ CompileUnitInfo *cu_info = GetCompileUnitInfo (GetSymbolFileAsSymbolFileDWARF(addr_module->GetSymbolVendor()->GetSymbolFile()));
if (cu_info)
{
const lldb::addr_t oso_file_addr = addr.GetFileAddress();
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h Fri May 10 16:47:16 2013
@@ -40,7 +40,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -112,12 +112,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
@@ -133,11 +130,9 @@ protected:
struct OSOInfo
{
lldb::ModuleSP module_sp;
- bool symbol_file_supported;
OSOInfo() :
- module_sp (),
- symbol_file_supported (true)
+ module_sp ()
{
}
};
@@ -153,6 +148,7 @@ protected:
{
lldb_private::FileSpec so_file;
lldb_private::ConstString oso_path;
+ lldb_private::TimeValue oso_mod_time;
OSOInfoSP oso_sp;
lldb::CompUnitSP compile_unit_sp;
uint32_t first_symbol_index;
@@ -166,6 +162,7 @@ protected:
CompileUnitInfo() :
so_file (),
oso_path (),
+ oso_mod_time (),
oso_sp (),
compile_unit_sp (),
first_symbol_index (UINT32_MAX),
@@ -192,6 +189,10 @@ protected:
{
return (uint32_t)((uid >> 32ull) - 1ull);
}
+
+ static SymbolFileDWARF *
+ GetSymbolFileAsSymbolFileDWARF (SymbolFile *sym_file);
+
bool
GetFileSpecForSO (uint32_t oso_idx, lldb_private::FileSpec &file_spec);
Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Fri May 10 16:47:16 2013
@@ -40,10 +40,11 @@ SymbolFileSymtab::Terminate()
}
-const char *
+lldb_private::ConstString
SymbolFileSymtab::GetPluginNameStatic()
{
- return "symbol-file.symtab";
+ static ConstString g_name("symtab");
+ return g_name;
}
const char *
@@ -387,15 +388,9 @@ SymbolFileSymtab::FindTypes (const lldb_
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
SymbolFileSymtab::GetPluginName()
{
- return "SymbolFileSymtab";
-}
-
-const char *
-SymbolFileSymtab::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h Fri May 10 16:47:16 2013
@@ -26,7 +26,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -113,12 +113,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp Fri May 10 16:47:16 2013
@@ -141,10 +141,11 @@ SymbolVendorMacOSX::Terminate()
}
-const char *
+lldb_private::ConstString
SymbolVendorMacOSX::GetPluginNameStatic()
{
- return "symbol-vendor.macosx";
+ static ConstString g_name("macosx");
+ return g_name;
}
const char *
@@ -332,15 +333,9 @@ SymbolVendorMacOSX::CreateInstance (cons
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+ConstString
SymbolVendorMacOSX::GetPluginName()
{
- return "SymbolVendorMacOSX";
-}
-
-const char *
-SymbolVendorMacOSX::GetShortPluginName()
-{
return GetPluginNameStatic();
}
Modified: lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h (original)
+++ lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h Fri May 10 16:47:16 2013
@@ -25,7 +25,7 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
@@ -45,12 +45,9 @@ public:
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp Fri May 10 16:47:16 2013
@@ -309,20 +309,12 @@ UnwindAssemblyInstEmulation::CreateInsta
//------------------------------------------------------------------
// PluginInterface protocol in UnwindAssemblyParser_x86
//------------------------------------------------------------------
-
-const char *
+ConstString
UnwindAssemblyInstEmulation::GetPluginName()
{
- return "UnwindAssemblyInstEmulation";
-}
-
-const char *
-UnwindAssemblyInstEmulation::GetShortPluginName()
-{
- return "unwindassembly.inst-emulation";
+ return GetPluginNameStatic();
}
-
uint32_t
UnwindAssemblyInstEmulation::GetPluginVersion()
{
@@ -344,10 +336,11 @@ UnwindAssemblyInstEmulation::Terminate()
}
-const char *
+ConstString
UnwindAssemblyInstEmulation::GetPluginNameStatic()
{
- return "UnwindAssemblyInstEmulation";
+ static ConstString g_name("inst-emulation");
+ return g_name;
}
const char *
Modified: lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h Fri May 10 16:47:16 2013
@@ -53,18 +53,15 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
GetPluginDescriptionStatic();
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Fri May 10 16:47:16 2013
@@ -931,16 +931,10 @@ UnwindAssembly_x86::CreateInstance (cons
// PluginInterface protocol in UnwindAssemblyParser_x86
//------------------------------------------------------------------
-const char *
+ConstString
UnwindAssembly_x86::GetPluginName()
{
- return "UnwindAssembly_x86";
-}
-
-const char *
-UnwindAssembly_x86::GetShortPluginName()
-{
- return "unwindassembly.x86";
+ return GetPluginNameStatic();
}
@@ -965,10 +959,11 @@ UnwindAssembly_x86::Terminate()
}
-const char *
+lldb_private::ConstString
UnwindAssembly_x86::GetPluginNameStatic()
{
- return "UnwindAssembly_x86";
+ static ConstString g_name("x86");
+ return g_name;
}
const char *
Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h Fri May 10 16:47:16 2013
@@ -50,18 +50,15 @@ public:
static void
Terminate();
- static const char *
+ static lldb_private::ConstString
GetPluginNameStatic();
static const char *
GetPluginDescriptionStatic();
- virtual const char *
+ virtual lldb_private::ConstString
GetPluginName();
- virtual const char *
- GetShortPluginName();
-
virtual uint32_t
GetPluginVersion();
Modified: lldb/trunk/source/Symbol/SymbolVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolVendor.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolVendor.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolVendor.cpp Fri May 10 16:47:16 2013
@@ -433,16 +433,11 @@ SymbolVendor::GetCompileUnitAtIndex(size
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
-const char *
+lldb_private::ConstString
SymbolVendor::GetPluginName()
{
- return "SymbolVendor";
-}
-
-const char *
-SymbolVendor::GetShortPluginName()
-{
- return "vendor-default";
+ static ConstString g_name("vendor-default");
+ return g_name;
}
uint32_t
Modified: lldb/trunk/source/Target/OperatingSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/OperatingSystem.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Target/OperatingSystem.cpp (original)
+++ lldb/trunk/source/Target/OperatingSystem.cpp Fri May 10 16:47:16 2013
@@ -25,7 +25,8 @@ OperatingSystem::FindPlugin (Process *pr
OperatingSystemCreateInstance create_callback = NULL;
if (plugin_name)
{
- create_callback = PluginManager::GetOperatingSystemCreateCallbackForPluginName (plugin_name);
+ ConstString const_plugin_name(plugin_name);
+ create_callback = PluginManager::GetOperatingSystemCreateCallbackForPluginName (const_plugin_name);
if (create_callback)
{
std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, true));
Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Fri May 10 16:47:16 2013
@@ -96,7 +96,7 @@ Platform::LocateExecutableScriptingResou
}
Platform*
-Platform::FindPlugin (Process *process, const char *plugin_name)
+Platform::FindPlugin (Process *process, const ConstString &plugin_name)
{
PlatformCreateInstance create_callback = NULL;
if (plugin_name)
@@ -156,7 +156,8 @@ Platform::Create (const char *platform_n
lldb::PlatformSP platform_sp;
if (platform_name && platform_name[0])
{
- create_callback = PluginManager::GetPlatformCreateCallbackForPluginName (platform_name);
+ ConstString const_platform_name (platform_name);
+ create_callback = PluginManager::GetPlatformCreateCallbackForPluginName (const_platform_name);
if (create_callback)
platform_sp.reset(create_callback(true, NULL));
else
@@ -273,7 +274,7 @@ Platform::GetStatus (Stream &strm)
uint32_t minor = UINT32_MAX;
uint32_t update = UINT32_MAX;
std::string s;
- strm.Printf (" Platform: %s\n", GetShortPluginName());
+ strm.Printf (" Platform: %s\n", GetPluginName().GetCString());
ArchSpec arch (GetSystemArchitecture());
if (arch.IsValid())
@@ -388,13 +389,13 @@ Platform::GetOSKernelDescription (std::s
return GetRemoteOSKernelDescription (s);
}
-const char *
+ConstString
Platform::GetName ()
{
const char *name = GetHostname();
if (name == NULL || name[0] == '\0')
- name = GetShortPluginName();
- return name;
+ return GetPluginName();
+ return ConstString (name);
}
const char *
@@ -592,9 +593,9 @@ Platform::ConnectRemote (Args& args)
{
Error error;
if (IsHost())
- error.SetErrorStringWithFormat ("The currently selected platform (%s) is the host platform and is always connected.", GetShortPluginName());
+ error.SetErrorStringWithFormat ("The currently selected platform (%s) is the host platform and is always connected.", GetPluginName().GetCString());
else
- error.SetErrorStringWithFormat ("Platform::ConnectRemote() is not supported by %s", GetShortPluginName());
+ error.SetErrorStringWithFormat ("Platform::ConnectRemote() is not supported by %s", GetPluginName().GetCString());
return error;
}
@@ -603,9 +604,9 @@ Platform::DisconnectRemote ()
{
Error error;
if (IsHost())
- error.SetErrorStringWithFormat ("The currently selected platform (%s) is the host platform and is always connected.", GetShortPluginName());
+ error.SetErrorStringWithFormat ("The currently selected platform (%s) is the host platform and is always connected.", GetPluginName().GetCString());
else
- error.SetErrorStringWithFormat ("Platform::DisconnectRemote() is not supported by %s", GetShortPluginName());
+ error.SetErrorStringWithFormat ("Platform::DisconnectRemote() is not supported by %s", GetPluginName().GetCString());
return error;
}
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=181631&r1=181630&r2=181631&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Fri May 10 16:47:16 2013
@@ -946,7 +946,8 @@ Process::FindPlugin (Target &target, con
ProcessCreateInstance create_callback = NULL;
if (plugin_name)
{
- create_callback = PluginManager::GetProcessCreateCallbackForPluginName (plugin_name);
+ ConstString const_plugin_name(plugin_name);
+ create_callback = PluginManager::GetProcessCreateCallbackForPluginName (const_plugin_name);
if (create_callback)
{
process_sp = create_callback(target, listener, crash_file_path);
More information about the lldb-commits
mailing list