Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins/LanguageRuntime; other minor fixes.

Differential Revision: http://reviews.llvm.org/D13966

llvm-svn: 250966
This commit is contained in:
Eugene Zelenko 2015-10-22 00:45:41 +00:00
parent 82ffb8e904
commit 05e0fc85b2
10 changed files with 368 additions and 430 deletions

View File

@ -1,4 +1,4 @@
//===-- ItaniumABILanguageRuntime.h ----------------------------------------*- C++ -*-===//
//===-- ItaniumABILanguageRuntime.h -----------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -12,6 +12,8 @@
// C Includes
// C++ Includes
#include <vector>
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
@ -20,33 +22,13 @@
#include "lldb/Target/CPPLanguageRuntime.h"
#include "lldb/Core/Value.h"
#include <map>
#include <vector>
namespace lldb_private {
class ItaniumABILanguageRuntime :
public lldb_private::CPPLanguageRuntime
{
public:
~ItaniumABILanguageRuntime() { }
virtual bool
IsVTableName (const char *name);
virtual bool
GetDynamicTypeAndAddress (ValueObject &in_value,
lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name,
Address &address,
Value::ValueType &value_type);
virtual TypeAndOrName
FixUpDynamicType (const TypeAndOrName& type_and_or_name,
ValueObject& static_value);
virtual bool
CouldHaveDynamicValue (ValueObject &in_value);
~ItaniumABILanguageRuntime() override = default;
//------------------------------------------------------------------
// Static Functions
@ -63,38 +45,54 @@ namespace lldb_private {
static lldb_private::ConstString
GetPluginNameStatic();
bool
IsVTableName(const char *name) override;
bool
GetDynamicTypeAndAddress(ValueObject &in_value,
lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name,
Address &address,
Value::ValueType &value_type) override;
TypeAndOrName
FixUpDynamicType(const TypeAndOrName& type_and_or_name,
ValueObject& static_value) override;
bool
CouldHaveDynamicValue(ValueObject &in_value) override;
void
SetExceptionBreakpoints() override;
void
ClearExceptionBreakpoints() override;
bool
ExceptionBreakpointsAreSet() override;
bool
ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override;
lldb::BreakpointResolverSP
CreateExceptionResolver(Breakpoint *bkpt, bool catch_bp, bool throw_bp) override;
lldb::SearchFilterSP
CreateExceptionSearchFilter() override;
size_t
GetAlternateManglings(const ConstString &mangled, std::vector<ConstString> &alternates) override;
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
GetPluginName();
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion();
virtual void
SetExceptionBreakpoints ();
virtual void
ClearExceptionBreakpoints ();
virtual bool
ExceptionBreakpointsAreSet ();
virtual bool
ExceptionBreakpointsExplainStop (lldb::StopInfoSP stop_reason);
virtual lldb::BreakpointResolverSP
CreateExceptionResolver (Breakpoint *bkpt, bool catch_bp, bool throw_bp);
virtual lldb::SearchFilterSP
CreateExceptionSearchFilter ();
virtual size_t
GetAlternateManglings(const ConstString &mangled, std::vector<ConstString> &alternates);
uint32_t
GetPluginVersion() override;
protected:
lldb::BreakpointResolverSP
CreateExceptionResolver (Breakpoint *bkpt, bool catch_bp, bool throw_bp, bool for_expressions);
@ -112,4 +110,4 @@ namespace lldb_private {
} // namespace lldb_private
#endif // liblldb_ItaniumABILanguageRuntime_h_
#endif // liblldb_ItaniumABILanguageRuntime_h_

View File

@ -1,4 +1,4 @@
//===-- GoLanguageRuntime.h ----------------------------------------*- C++ -*-===//
//===-- GoLanguageRuntime.h -------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -25,7 +25,22 @@ namespace lldb_private {
public lldb_private::LanguageRuntime
{
public:
~GoLanguageRuntime() { }
~GoLanguageRuntime() override = default;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
static void
Initialize();
static void
Terminate();
static lldb_private::LanguageRuntime *
CreateInstance(Process *process, lldb::LanguageType language);
static lldb_private::ConstString
GetPluginNameStatic();
lldb::LanguageType
GetLanguageType() const override
@ -60,21 +75,6 @@ namespace lldb_private {
TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value) override;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
static void
Initialize();
static void
Terminate();
static lldb_private::LanguageRuntime *
CreateInstance (Process *process, lldb::LanguageType language);
static lldb_private::ConstString
GetPluginNameStatic();
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
@ -90,4 +90,4 @@ namespace lldb_private {
} // namespace lldb_private
#endif // liblldb_GoLanguageRuntime_h_
#endif // liblldb_GoLanguageRuntime_h_

View File

@ -1,4 +1,4 @@
//===-- AppleObjCClassDescriptorV2.h --------------------------------*- C++ -*-===//
//===-- AppleObjCClassDescriptorV2.h ----------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -13,7 +13,6 @@
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Host/Mutex.h"
@ -27,71 +26,57 @@ class ClassDescriptorV2 : public ObjCLanguageRuntime::ClassDescriptor
public:
friend class lldb_private::AppleObjCRuntimeV2;
private:
// The constructor should only be invoked by the runtime as it builds its caches
// or populates them. A ClassDescriptorV2 should only ever exist in a cache.
ClassDescriptorV2 (AppleObjCRuntimeV2 &runtime, ObjCLanguageRuntime::ObjCISA isa, const char *name) :
m_runtime (runtime),
m_objc_class_ptr (isa),
m_name (name),
m_ivars_storage()
{
}
~ClassDescriptorV2() override = default;
ConstString
GetClassName() override;
public:
virtual ConstString
GetClassName ();
ObjCLanguageRuntime::ClassDescriptorSP
GetSuperclass() override;
virtual ObjCLanguageRuntime::ClassDescriptorSP
GetSuperclass ();
ObjCLanguageRuntime::ClassDescriptorSP
GetMetaclass() const override;
virtual ObjCLanguageRuntime::ClassDescriptorSP
GetMetaclass () const;
virtual bool
IsValid ()
bool
IsValid() override
{
return true; // any Objective-C v2 runtime class descriptor we vend is valid
}
// a custom descriptor is used for tagged pointers
virtual bool
GetTaggedPointerInfo (uint64_t* info_bits = NULL,
uint64_t* value_bits = NULL,
uint64_t* payload = NULL)
bool
GetTaggedPointerInfo(uint64_t* info_bits = nullptr,
uint64_t* value_bits = nullptr,
uint64_t* payload = nullptr) override
{
return false;
}
virtual uint64_t
GetInstanceSize ();
uint64_t
GetInstanceSize() override;
virtual ObjCLanguageRuntime::ObjCISA
GetISA ()
ObjCLanguageRuntime::ObjCISA
GetISA() override
{
return m_objc_class_ptr;
}
virtual bool
Describe (std::function <void (ObjCLanguageRuntime::ObjCISA)> const &superclass_func,
std::function <bool (const char *, const char *)> const &instance_method_func,
std::function <bool (const char *, const char *)> const &class_method_func,
std::function <bool (const char *, const char *, lldb::addr_t, uint64_t)> const &ivar_func) const;
virtual
~ClassDescriptorV2 ()
{
}
virtual size_t
GetNumIVars ()
bool
Describe(std::function <void (ObjCLanguageRuntime::ObjCISA)> const &superclass_func,
std::function <bool (const char *, const char *)> const &instance_method_func,
std::function <bool (const char *, const char *)> const &class_method_func,
std::function <bool (const char *, const char *,
lldb::addr_t, uint64_t)> const &ivar_func) const override;
size_t
GetNumIVars() override
{
GetIVarInformation();
return m_ivars_storage.size();
}
virtual iVarDescriptor
GetIVarAtIndex (size_t idx)
iVarDescriptor
GetIVarAtIndex(size_t idx) override
{
if (idx >= GetNumIVars())
return iVarDescriptor();
@ -265,6 +250,16 @@ private:
Mutex m_mutex;
};
// The constructor should only be invoked by the runtime as it builds its caches
// or populates them. A ClassDescriptorV2 should only ever exist in a cache.
ClassDescriptorV2(AppleObjCRuntimeV2 &runtime, ObjCLanguageRuntime::ObjCISA isa, const char *name) :
m_runtime (runtime),
m_objc_class_ptr (isa),
m_name (name),
m_ivars_storage()
{
}
bool
Read_objc_class (Process* process, std::unique_ptr<objc_class_t> &objc_class) const;
@ -316,14 +311,16 @@ public:
m_value_bits = (m_payload & ~0x0FULL) >> 4;
}
virtual ConstString
GetClassName ()
~ClassDescriptorV2Tagged() override = default;
ConstString
GetClassName() override
{
return m_name;
}
virtual ObjCLanguageRuntime::ClassDescriptorSP
GetSuperclass ()
ObjCLanguageRuntime::ClassDescriptorSP
GetSuperclass() override
{
// tagged pointers can represent a class that has a superclass, but since that information is not
// stored in the object itself, we would have to query the runtime to discover the hierarchy
@ -331,34 +328,34 @@ public:
return ObjCLanguageRuntime::ClassDescriptorSP();
}
virtual ObjCLanguageRuntime::ClassDescriptorSP
GetMetaclass () const
ObjCLanguageRuntime::ClassDescriptorSP
GetMetaclass() const override
{
return ObjCLanguageRuntime::ClassDescriptorSP();
}
virtual bool
IsValid ()
bool
IsValid() override
{
return m_valid;
}
virtual bool
IsKVO ()
bool
IsKVO() override
{
return false; // tagged pointers are not KVO'ed
}
virtual bool
IsCFType ()
bool
IsCFType() override
{
return false; // tagged pointers are not CF objects
}
virtual bool
GetTaggedPointerInfo (uint64_t* info_bits = NULL,
uint64_t* value_bits = NULL,
uint64_t* payload = NULL)
bool
GetTaggedPointerInfo(uint64_t* info_bits = nullptr,
uint64_t* value_bits = nullptr,
uint64_t* payload = nullptr) override
{
if (info_bits)
*info_bits = GetInfoBits();
@ -369,14 +366,14 @@ public:
return true;
}
virtual uint64_t
GetInstanceSize ()
uint64_t
GetInstanceSize() override
{
return (IsValid() ? m_pointer_size : 0);
}
virtual ObjCLanguageRuntime::ObjCISA
GetISA ()
ObjCLanguageRuntime::ObjCISA
GetISA() override
{
return 0; // tagged pointers have no ISA
}
@ -399,11 +396,7 @@ public:
{
return (IsValid() ? m_payload : 0);
}
virtual
~ClassDescriptorV2Tagged ()
{}
private:
ConstString m_name;
uint8_t m_pointer_size;
@ -411,10 +404,8 @@ private:
uint64_t m_info_bits;
uint64_t m_value_bits;
uint64_t m_payload;
};
} // namespace lldb_private
#endif // liblldb_AppleObjCRuntime_h_
#endif // liblldb_AppleObjCClassDescriptorV2_h_

View File

@ -12,11 +12,7 @@
// C Includes
// C++ Includes
#include <map>
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Symbol/ClangASTContext.h"
@ -32,13 +28,14 @@ class AppleObjCDeclVendor : public DeclVendor
public:
AppleObjCDeclVendor(ObjCLanguageRuntime &runtime);
virtual uint32_t
FindDecls (const ConstString &name,
bool append,
uint32_t max_matches,
std::vector <clang::NamedDecl *> &decls);
uint32_t
FindDecls(const ConstString &name,
bool append,
uint32_t max_matches,
std::vector <clang::NamedDecl *> &decls) override;
friend class AppleObjCExternalASTSource;
private:
clang::ObjCInterfaceDecl *GetDeclForISA(ObjCLanguageRuntime::ObjCISA isa);
bool FinishDecl(clang::ObjCInterfaceDecl *decl);
@ -55,4 +52,4 @@ private:
} // namespace lldb_private
#endif // liblldb_AppleObjCDeclVendor_h_
#endif // liblldb_AppleObjCDeclVendor_h_

View File

@ -1,4 +1,4 @@
//===-- AppleObjCRuntime.h ----------------------------------------*- C++ -*-===//
//===-- AppleObjCRuntime.h --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -13,7 +13,6 @@
// C Includes
// C++ Includes
// Other libraries and framework includes
#include "llvm/ADT/Optional.h"
// Project includes
@ -29,6 +28,14 @@ class AppleObjCRuntime :
public lldb_private::ObjCLanguageRuntime
{
public:
~AppleObjCRuntime() override;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
// Note there is no CreateInstance, Initialize & Terminate functions here, because
// you can't make an instance of this generic runtime.
static bool classof(const ObjCLanguageRuntime* runtime)
{
switch (runtime->GetRuntimeVersion())
@ -41,8 +48,6 @@ public:
}
}
virtual ~AppleObjCRuntime();
// These are generic runtime functions:
bool
GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope) override;
@ -86,54 +91,45 @@ public:
lldb::ModuleSP
GetObjCModule ();
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
// Note there is no CreateInstance, Initialize & Terminate functions here, because
// you can't make an instance of this generic runtime.
// Sync up with the target
void
ModulesDidLoad (const ModuleList &module_list) override;
protected:
bool
CalculateHasNewLiteralsAndIndexing() override;
static bool
AppleIsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
static ObjCRuntimeVersions
GetObjCVersion (Process *process, lldb::ModuleSP &objc_module_sp);
void
ReadObjCLibraryIfNeeded (const ModuleList &module_list);
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
public:
void
SetExceptionBreakpoints() override;
void
ClearExceptionBreakpoints () override;
ClearExceptionBreakpoints() override;
bool
ExceptionBreakpointsAreSet () override;
ExceptionBreakpointsAreSet() override;
bool
ExceptionBreakpointsExplainStop (lldb::StopInfoSP stop_reason) override;
ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override;
lldb::SearchFilterSP
CreateExceptionSearchFilter () override;
CreateExceptionSearchFilter() override;
uint32_t
GetFoundationVersion ();
GetFoundationVersion();
protected:
// Call CreateInstance instead.
AppleObjCRuntime(Process *process);
bool
CalculateHasNewLiteralsAndIndexing() override;
static bool
AppleIsModuleObjCLibrary(const lldb::ModuleSP &module_sp);
static ObjCRuntimeVersions
GetObjCVersion(Process *process, lldb::ModuleSP &objc_module_sp);
void
ReadObjCLibraryIfNeeded(const ModuleList &module_list);
Address *
GetPrintForDebuggerAddr();
@ -145,11 +141,8 @@ protected:
std::unique_ptr<FunctionCaller> m_print_object_caller_up;
llvm::Optional<uint32_t> m_Foundation_major;
// Call CreateInstance instead.
AppleObjCRuntime(Process *process);
};
} // namespace lldb_private
#endif // liblldb_AppleObjCRuntime_h_
#endif // liblldb_AppleObjCRuntime_h_

View File

@ -1,4 +1,4 @@
//===-- AppleObjCRuntimeV1.h ----------------------------------------*- C++ -*-===//
//===-- AppleObjCRuntimeV1.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -24,6 +24,23 @@ class AppleObjCRuntimeV1 :
public AppleObjCRuntime
{
public:
~AppleObjCRuntimeV1() override = default;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
static void
Initialize();
static void
Terminate();
static lldb_private::LanguageRuntime *
CreateInstance(Process *process, lldb::LanguageType language);
static lldb_private::ConstString
GetPluginNameStatic();
static bool classof(const ObjCLanguageRuntime* runtime)
{
switch (runtime->GetRuntimeVersion())
@ -41,55 +58,54 @@ public:
ClassDescriptorV1 (ValueObject &isa_pointer);
ClassDescriptorV1 (ObjCISA isa, lldb::ProcessSP process_sp);
virtual ConstString
GetClassName ()
~ClassDescriptorV1() override = default;
ConstString
GetClassName() override
{
return m_name;
}
virtual ClassDescriptorSP
GetSuperclass ();
ClassDescriptorSP
GetSuperclass() override;
virtual ClassDescriptorSP
GetMetaclass () const;
ClassDescriptorSP
GetMetaclass() const override;
virtual bool
IsValid ()
bool
IsValid() override
{
return m_valid;
}
// v1 does not support tagged pointers
virtual bool
GetTaggedPointerInfo (uint64_t* info_bits = NULL,
uint64_t* value_bits = NULL,
uint64_t* payload = NULL)
bool
GetTaggedPointerInfo(uint64_t* info_bits = nullptr,
uint64_t* value_bits = nullptr,
uint64_t* payload = nullptr) override
{
return false;
}
virtual uint64_t
GetInstanceSize ()
uint64_t
GetInstanceSize() override
{
return m_instance_size;
}
virtual ObjCISA
GetISA ()
ObjCISA
GetISA() override
{
return m_isa;
}
virtual bool
Describe (std::function <void (ObjCLanguageRuntime::ObjCISA)> const &superclass_func,
std::function <bool (const char *, const char *)> const &instance_method_func,
std::function <bool (const char *, const char *)> const &class_method_func,
std::function <bool (const char *, const char *, lldb::addr_t, uint64_t)> const &ivar_func) const;
virtual
~ClassDescriptorV1 ()
{}
bool
Describe(std::function <void (ObjCLanguageRuntime::ObjCISA)> const &superclass_func,
std::function <bool (const char *, const char *)> const &instance_method_func,
std::function <bool (const char *, const char *)> const &class_method_func,
std::function <bool (const char *, const char *,
lldb::addr_t, uint64_t)> const &ivar_func) const override;
protected:
void
Initialize (ObjCISA isa, lldb::ProcessSP process_sp);
@ -102,60 +118,42 @@ public:
lldb::ProcessWP m_process_wp;
uint64_t m_instance_size;
};
virtual ~AppleObjCRuntimeV1() { }
// These are generic runtime functions:
virtual bool
GetDynamicTypeAndAddress (ValueObject &in_value,
lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name,
Address &address,
Value::ValueType &value_type);
bool
GetDynamicTypeAndAddress(ValueObject &in_value,
lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name,
Address &address,
Value::ValueType &value_type) override;
virtual UtilityFunction *
CreateObjectChecker (const char *);
UtilityFunction *
CreateObjectChecker(const char *) override;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
static void
Initialize();
static void
Terminate();
static lldb_private::LanguageRuntime *
CreateInstance (Process *process, lldb::LanguageType language);
static lldb_private::ConstString
GetPluginNameStatic();
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual ConstString
GetPluginName();
ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion();
uint32_t
GetPluginVersion() override;
virtual ObjCRuntimeVersions
GetRuntimeVersion () const
ObjCRuntimeVersions
GetRuntimeVersion() const override
{
return ObjCRuntimeVersions::eAppleObjC_V1;
}
virtual void
UpdateISAToDescriptorMapIfNeeded();
void
UpdateISAToDescriptorMapIfNeeded() override;
virtual DeclVendor *
GetDeclVendor();
DeclVendor *
GetDeclVendor() override;
protected:
virtual lldb::BreakpointResolverSP
CreateExceptionResolver (Breakpoint *bkpt, bool catch_bp, bool throw_bp);
lldb::BreakpointResolverSP
CreateExceptionResolver(Breakpoint *bkpt, bool catch_bp, bool throw_bp) override;
class HashTableSignature
{
@ -193,17 +191,17 @@ protected:
lldb::addr_t m_buckets_ptr;
};
lldb::addr_t
GetISAHashTablePointer ();
HashTableSignature m_hash_signature;
lldb::addr_t m_isa_hash_table_ptr;
std::unique_ptr<DeclVendor> m_decl_vendor_ap;
private:
AppleObjCRuntimeV1(Process *process);
};
} // namespace lldb_private
#endif // liblldb_AppleObjCRuntimeV1_h_
#endif // liblldb_AppleObjCRuntimeV1_h_

View File

@ -1,4 +1,4 @@
//===-- AppleObjCRuntimeV2.cpp --------------------------------------*- C++ -*-===//
//===-- AppleObjCRuntimeV2.cpp ----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,10 +7,18 @@
//
//===----------------------------------------------------------------------===//
#include <string>
#include <vector>
// C Includes
#include <stdint.h>
// C++ Includes
#include <string>
#include <vector>
// Other libraries and framework includes
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
// Project includes
#include "lldb/lldb-enumerations.h"
#include "lldb/Core/ClangForward.h"
#include "lldb/Symbol/CompilerType.h"
@ -52,13 +60,8 @@
#include "AppleObjCDeclVendor.h"
#include "AppleObjCTrampolineHandler.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "Plugins/Platform/MacOSX/PlatformiOSSimulator.h"
#include <vector>
using namespace lldb;
using namespace lldb_private;
@ -342,7 +345,6 @@ ExtractRuntimeGlobalSymbol (Process* process,
error.SetErrorString("no symbol");
return default_value;
}
}
AppleObjCRuntimeV2::AppleObjCRuntimeV2 (Process *process,
@ -368,10 +370,6 @@ AppleObjCRuntimeV2::AppleObjCRuntimeV2 (Process *process,
m_has_object_getClass = (objc_module_sp->FindFirstSymbolWithNameAndType(g_gdb_object_getClass, eSymbolTypeCode) != NULL);
}
AppleObjCRuntimeV2::~AppleObjCRuntimeV2()
{
}
bool
AppleObjCRuntimeV2::GetDynamicTypeAndAddress (ValueObject &in_value,
DynamicValueType use_dynamic,
@ -450,7 +448,6 @@ AppleObjCRuntimeV2::CreateInstance (Process *process, LanguageType language)
class CommandObjectObjC_ClassTable_Dump : public CommandObjectParsed
{
public:
CommandObjectObjC_ClassTable_Dump (CommandInterpreter &interpreter) :
CommandObjectParsed (interpreter,
"dump",
@ -461,14 +458,12 @@ public:
eCommandProcessMustBePaused )
{
}
~CommandObjectObjC_ClassTable_Dump ()
{
}
~CommandObjectObjC_ClassTable_Dump() override = default;
protected:
bool
DoExecute (Args& command, CommandReturnObject &result)
DoExecute(Args& command, CommandReturnObject &result) override
{
Process *process = m_exe_ctx.GetProcessPtr();
ObjCLanguageRuntime *objc_runtime = process->GetObjCLanguageRuntime();
@ -510,7 +505,6 @@ protected:
class CommandObjectMultiwordObjC_TaggedPointer_Info : public CommandObjectParsed
{
public:
CommandObjectMultiwordObjC_TaggedPointer_Info (CommandInterpreter &interpreter) :
CommandObjectParsed (interpreter,
"info",
@ -533,14 +527,12 @@ public:
// Push the data for the first argument into the m_arguments vector.
m_arguments.push_back (arg);
}
~CommandObjectMultiwordObjC_TaggedPointer_Info ()
{
}
~CommandObjectMultiwordObjC_TaggedPointer_Info() override = default;
protected:
bool
DoExecute (Args& command, CommandReturnObject &result)
DoExecute(Args& command, CommandReturnObject &result) override
{
if (command.GetArgumentCount() == 0)
{
@ -610,7 +602,6 @@ protected:
class CommandObjectMultiwordObjC_ClassTable : public CommandObjectMultiword
{
public:
CommandObjectMultiwordObjC_ClassTable (CommandInterpreter &interpreter) :
CommandObjectMultiword (interpreter,
"class-table",
@ -619,11 +610,8 @@ public:
{
LoadSubCommand ("dump", CommandObjectSP (new CommandObjectObjC_ClassTable_Dump (interpreter)));
}
virtual
~CommandObjectMultiwordObjC_ClassTable ()
{
}
~CommandObjectMultiwordObjC_ClassTable() override = default;
};
class CommandObjectMultiwordObjC_TaggedPointer : public CommandObjectMultiword
@ -638,17 +626,13 @@ public:
{
LoadSubCommand ("info", CommandObjectSP (new CommandObjectMultiwordObjC_TaggedPointer_Info (interpreter)));
}
virtual
~CommandObjectMultiwordObjC_TaggedPointer ()
{
}
~CommandObjectMultiwordObjC_TaggedPointer() override = default;
};
class CommandObjectMultiwordObjC : public CommandObjectMultiword
{
public:
CommandObjectMultiwordObjC (CommandInterpreter &interpreter) :
CommandObjectMultiword (interpreter,
"objc",
@ -658,11 +642,8 @@ public:
LoadSubCommand ("class-table", CommandObjectSP (new CommandObjectMultiwordObjC_ClassTable (interpreter)));
LoadSubCommand ("tagged-pointer", CommandObjectSP (new CommandObjectMultiwordObjC_TaggedPointer (interpreter)));
}
virtual
~CommandObjectMultiwordObjC ()
{
}
~CommandObjectMultiwordObjC() override = default;
};
void
@ -689,7 +670,6 @@ AppleObjCRuntimeV2::GetPluginNameStatic()
return g_name;
}
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
@ -836,7 +816,6 @@ AppleObjCRuntimeV2::GetByteOffsetForIvar (CompilerType &parent_ast_type, const c
return ivar_offset;
}
// tagged pointers are special not-a-real-pointer values that contain both type and value information
// this routine attempts to check with as little computational effort as possible whether something
// could possibly be a tagged pointer - false positives are possible but false negatives shouldn't
@ -851,7 +830,6 @@ AppleObjCRuntimeV2::IsTaggedPointer(addr_t ptr)
class RemoteNXMapTable
{
public:
RemoteNXMapTable () :
m_count (0),
m_num_buckets_minus_one (0),
@ -996,6 +974,7 @@ public:
return element(ConstString(key_string.c_str()), (ObjCLanguageRuntime::ObjCISA)value);
}
private:
void AdvanceToValidIndex ()
{
@ -1072,8 +1051,6 @@ private:
lldb::addr_t m_invalid_key;
};
AppleObjCRuntimeV2::HashTableSignature::HashTableSignature() :
m_count (0),
m_num_buckets (0),
@ -1312,10 +1289,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table
}
arguments = get_class_info_function->GetArgumentValues();
}
errors.Clear();
const uint32_t class_info_byte_size = addr_size + 4;
@ -1672,7 +1646,6 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache()
return DescriptorMapUpdateResult(success, any_found);
}
bool
AppleObjCRuntimeV2::UpdateISAToDescriptorMapFromMemory (RemoteNXMapTable &hash_table)
{
@ -1780,7 +1753,6 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapIfNeeded()
else
m_loaded_objc_opt = true;
}
}
else
{

View File

@ -1,4 +1,4 @@
//===-- AppleObjCRuntimeV2.h ----------------------------------------*- C++ -*-===//
//===-- AppleObjCRuntimeV2.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -12,7 +12,6 @@
// C Includes
// C++ Includes
#include <map>
#include <memory>
@ -30,30 +29,7 @@ class AppleObjCRuntimeV2 :
public AppleObjCRuntime
{
public:
static bool classof(const ObjCLanguageRuntime* runtime)
{
switch (runtime->GetRuntimeVersion())
{
case ObjCRuntimeVersions::eAppleObjC_V2:
return true;
default:
return false;
}
}
virtual ~AppleObjCRuntimeV2();
// These are generic runtime functions:
virtual bool
GetDynamicTypeAndAddress (ValueObject &in_value,
lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name,
Address &address,
Value::ValueType &value_type);
virtual UtilityFunction *
CreateObjectChecker (const char *);
~AppleObjCRuntimeV2() override = default;
//------------------------------------------------------------------
// Static Functions
@ -69,27 +45,73 @@ public:
static lldb_private::ConstString
GetPluginNameStatic();
static bool classof(const ObjCLanguageRuntime* runtime)
{
switch (runtime->GetRuntimeVersion())
{
case ObjCRuntimeVersions::eAppleObjC_V2:
return true;
default:
return false;
}
}
// These are generic runtime functions:
bool
GetDynamicTypeAndAddress(ValueObject &in_value,
lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name,
Address &address,
Value::ValueType &value_type) override;
UtilityFunction *
CreateObjectChecker(const char *) override;
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual ConstString
GetPluginName();
ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion();
uint32_t
GetPluginVersion() override;
virtual ObjCRuntimeVersions
GetRuntimeVersion () const
ObjCRuntimeVersions
GetRuntimeVersion() const override
{
return ObjCRuntimeVersions::eAppleObjC_V2;
}
virtual size_t
GetByteOffsetForIvar (CompilerType &parent_qual_type, const char *ivar_name);
size_t
GetByteOffsetForIvar(CompilerType &parent_qual_type, const char *ivar_name) override;
virtual void
UpdateISAToDescriptorMapIfNeeded();
void
UpdateISAToDescriptorMapIfNeeded() override;
ConstString
GetActualTypeName(ObjCLanguageRuntime::ObjCISA isa) override;
ClassDescriptorSP
GetClassDescriptor(ValueObject& in_value) override;
ClassDescriptorSP
GetClassDescriptorFromISA(ObjCISA isa) override;
DeclVendor *
GetDeclVendor() override;
lldb::addr_t
LookupRuntimeSymbol(const ConstString &name) override;
EncodingToTypeSP
GetEncodingToType() override;
TaggedPointerVendor*
GetTaggedPointerVendor() override
{
return m_tagged_pointer_vendor_ap.get();
}
// none of these are valid ISAs - we use them to infer the type
// of tagged pointers - if we have something meaningful to say
@ -102,36 +124,11 @@ public:
static const ObjCLanguageRuntime::ObjCISA g_objc_Tagged_ISA_NSManagedObject = 5;
static const ObjCLanguageRuntime::ObjCISA g_objc_Tagged_ISA_NSDate = 6;
virtual ConstString
GetActualTypeName(ObjCLanguageRuntime::ObjCISA isa);
virtual ClassDescriptorSP
GetClassDescriptor (ValueObject& in_value);
virtual ClassDescriptorSP
GetClassDescriptorFromISA (ObjCISA isa);
virtual DeclVendor *
GetDeclVendor();
virtual lldb::addr_t
LookupRuntimeSymbol (const ConstString &name);
virtual EncodingToTypeSP
GetEncodingToType ();
virtual TaggedPointerVendor*
GetTaggedPointerVendor ()
{
return m_tagged_pointer_vendor_ap.get();
}
protected:
virtual lldb::BreakpointResolverSP
CreateExceptionResolver (Breakpoint *bkpt, bool catch_bp, bool throw_bp);
lldb::BreakpointResolverSP
CreateExceptionResolver(Breakpoint *bkpt, bool catch_bp, bool throw_bp) override;
private:
class HashTableSignature
{
public:
@ -144,6 +141,7 @@ private:
void
UpdateSignature (const RemoteNXMapTable &hash_table);
protected:
uint32_t m_count;
uint32_t m_num_buckets;
@ -160,6 +158,7 @@ private:
ObjCLanguageRuntime::ClassDescriptorSP
GetClassDescriptor (ObjCISA isa);
private:
NonPointerISACache (AppleObjCRuntimeV2& runtime,
uint64_t objc_debug_isa_class_mask,
@ -183,12 +182,12 @@ private:
class TaggedPointerVendorV2 : public ObjCLanguageRuntime::TaggedPointerVendor
{
public:
~TaggedPointerVendorV2() override = default;
static TaggedPointerVendorV2*
CreateInstance (AppleObjCRuntimeV2& runtime,
const lldb::ModuleSP& objc_module_sp);
virtual
~TaggedPointerVendorV2 () { }
protected:
AppleObjCRuntimeV2& m_runtime;
@ -197,19 +196,20 @@ private:
m_runtime(runtime)
{
}
private:
DISALLOW_COPY_AND_ASSIGN(TaggedPointerVendorV2);
};
class TaggedPointerVendorRuntimeAssisted : public TaggedPointerVendorV2
{
public:
virtual bool
IsPossibleTaggedPointer (lldb::addr_t ptr);
bool
IsPossibleTaggedPointer(lldb::addr_t ptr) override;
virtual ObjCLanguageRuntime::ClassDescriptorSP
GetClassDescriptor (lldb::addr_t ptr);
ObjCLanguageRuntime::ClassDescriptorSP
GetClassDescriptor(lldb::addr_t ptr) override;
protected:
TaggedPointerVendorRuntimeAssisted (AppleObjCRuntimeV2& runtime,
uint64_t objc_debug_taggedpointer_mask,
@ -237,11 +237,12 @@ private:
class TaggedPointerVendorLegacy : public TaggedPointerVendorV2
{
public:
virtual bool
IsPossibleTaggedPointer (lldb::addr_t ptr);
bool
IsPossibleTaggedPointer(lldb::addr_t ptr) override;
virtual ObjCLanguageRuntime::ClassDescriptorSP
GetClassDescriptor (lldb::addr_t ptr);
ObjCLanguageRuntime::ClassDescriptorSP
GetClassDescriptor (lldb::addr_t ptr) override;
protected:
TaggedPointerVendorLegacy (AppleObjCRuntimeV2& runtime) :
TaggedPointerVendorV2 (runtime)
@ -332,4 +333,4 @@ private:
} // namespace lldb_private
#endif // liblldb_AppleObjCRuntimeV2_h_
#endif // liblldb_AppleObjCRuntimeV2_h_

View File

@ -12,15 +12,13 @@
// C Includes
// C++ Includes
// Other libraries and framework includes
#include "clang/AST/ASTContext.h"
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/ObjCLanguageRuntime.h"
#include "clang/AST/ASTContext.h"
namespace lldb_utility {
class StringLexer;
}
@ -31,9 +29,10 @@ namespace lldb_private {
{
public:
AppleObjCTypeEncodingParser (ObjCLanguageRuntime& runtime);
virtual CompilerType RealizeType (clang::ASTContext &ast_ctx, const char* name, bool for_expression);
virtual ~AppleObjCTypeEncodingParser() {}
~AppleObjCTypeEncodingParser() override = default;
CompilerType RealizeType(clang::ASTContext &ast_ctx, const char* name, bool for_expression) override;
private:
struct StructElement {
std::string name;
@ -79,4 +78,4 @@ namespace lldb_private {
} // namespace lldb_private
#endif // liblldb_AppleObjCTypeEncodingParser_h_
#endif // liblldb_AppleObjCTypeEncodingParser_h_

View File

@ -1,4 +1,4 @@
//===-- AppleThreadPlanStepThroughObjCTrampoline.h --------------------------*- C++ -*-===//
//===-- AppleThreadPlanStepThroughObjCTrampoline.h --------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -26,67 +26,56 @@ namespace lldb_private
class AppleThreadPlanStepThroughObjCTrampoline : public ThreadPlan
{
public:
//------------------------------------------------------------------
// Constructors and Destructors
//------------------------------------------------------------------
AppleThreadPlanStepThroughObjCTrampoline(Thread &thread,
AppleThreadPlanStepThroughObjCTrampoline(Thread &thread,
AppleObjCTrampolineHandler *trampoline_handler,
ValueList &values,
lldb::addr_t isa_addr,
lldb::addr_t sel_addr,
bool stop_others);
virtual ~AppleThreadPlanStepThroughObjCTrampoline();
virtual void
GetDescription (Stream *s,
lldb::DescriptionLevel level);
~AppleThreadPlanStepThroughObjCTrampoline() override;
static bool
PreResumeInitializeFunctionCaller(void *myself);
void
GetDescription(Stream *s,
lldb::DescriptionLevel level) override;
virtual bool
ValidatePlan (Stream *error);
bool
ValidatePlan(Stream *error) override;
virtual lldb::StateType
GetPlanRunState ();
lldb::StateType
GetPlanRunState() override;
virtual bool
ShouldStop (Event *event_ptr);
bool
ShouldStop(Event *event_ptr) override;
virtual bool
StopOthers()
bool
StopOthers() override
{
return m_stop_others;
}
// The base class MischiefManaged does some cleanup - so you have to call it
// in your MischiefManaged derived class.
virtual bool
MischiefManaged ();
bool
MischiefManaged() override;
virtual void
DidPush();
void
DidPush() override;
static bool
PreResumeInitializeFunctionCaller(void *myself);
virtual bool
WillStop();
bool
WillStop() override;
protected:
//------------------------------------------------------------------
// Classes that inherit from AppleThreadPlanStepThroughObjCTrampoline can see and modify these
//------------------------------------------------------------------
virtual bool
DoPlanExplainsStop (Event *event_ptr);
bool
DoPlanExplainsStop(Event *event_ptr) override;
private:
bool
InitializeFunctionCaller ();
//------------------------------------------------------------------
// For AppleThreadPlanStepThroughObjCTrampoline only
//------------------------------------------------------------------
AppleObjCTrampolineHandler *m_trampoline_handler; // FIXME - ensure this doesn't go away on us? SP maybe?
lldb::addr_t m_args_addr; // Stores the address for our step through function result structure.
//lldb::addr_t m_object_addr; // This is only for Description.
@ -103,4 +92,4 @@ private:
} // namespace lldb_private
#endif // lldb_AppleThreadPlanStepThroughObjCTrampoline_h_
#endif // lldb_AppleThreadPlanStepThroughObjCTrampoline_h_