summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2011-01-17 23:06:54 +0000
committerJim Ingham <jingham@apple.com>2011-01-17 23:06:54 +0000
commit5caed4e8a878a07b25d13ed355e7d049bbbe4ec4 (patch)
tree3722fb164db90d18752aded66a1ffcdbaa2043e1
parentbd91f501900efaafe140b8b7875af7224a4cb710 (diff)
downloadbcm5719-llvm-5caed4e8a878a07b25d13ed355e7d049bbbe4ec4.tar.gz
bcm5719-llvm-5caed4e8a878a07b25d13ed355e7d049bbbe4ec4.zip
Add a method on the ObjC Language Runtime that returns the runtime version.
llvm-svn: 123693
-rw-r--r--lldb/include/lldb/Target/ObjCLanguageRuntime.h6
-rw-r--r--lldb/include/lldb/lldb-enumerations.h6
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp12
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h8
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h5
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h6
8 files changed, 32 insertions, 15 deletions
diff --git a/lldb/include/lldb/Target/ObjCLanguageRuntime.h b/lldb/include/lldb/Target/ObjCLanguageRuntime.h
index 0ec0bfea265..bd4fc99c09f 100644
--- a/lldb/include/lldb/Target/ObjCLanguageRuntime.h
+++ b/lldb/include/lldb/Target/ObjCLanguageRuntime.h
@@ -58,6 +58,12 @@ public:
virtual ClangUtilityFunction *
CreateObjectChecker (const char *) = 0;
+ virtual lldb::ObjCRuntimeVersions
+ GetRuntimeVersion ()
+ {
+ return lldb::eObjC_VersionUnknown;
+ }
+
protected:
//------------------------------------------------------------------
// Classes that inherit from ObjCLanguageRuntime can see and modify these
diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h
index 29874dc0ded..ba594603efb 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -633,6 +633,12 @@ typedef enum ExecutionResults
eExecutionTimedOut
} ExecutionResults;
+typedef enum ObjCRuntimeVersions {
+ eObjC_VersionUnknown = 0,
+ eAppleObjC_V1 = 1,
+ eAppleObjC_V2 = 2
+} ObjCRuntimeVersions;
+
} // namespace lldb
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index 804b388e68a..dff1e37039e 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -240,7 +240,7 @@ AppleObjCRuntime::GetStepThroughTrampolinePlan (Thread &thread, bool stop_others
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
-enum AppleObjCRuntime::RuntimeVersions
+enum lldb::ObjCRuntimeVersions
AppleObjCRuntime::GetObjCVersion (Process *process, ModuleSP &objc_module_sp)
{
ModuleList &images = process->GetTarget().GetImages();
@@ -253,21 +253,21 @@ AppleObjCRuntime::GetObjCVersion (Process *process, ModuleSP &objc_module_sp)
objc_module_sp = module_sp;
ObjectFile *ofile = module_sp->GetObjectFile();
if (!ofile)
- return eObjC_VersionUnknown;
+ return lldb::eObjC_VersionUnknown;
SectionList *sections = ofile->GetSectionList();
if (!sections)
- return eObjC_VersionUnknown;
+ return lldb::eObjC_VersionUnknown;
SectionSP v1_telltale_section_sp = sections->FindSectionByName(ConstString ("__OBJC"));
if (v1_telltale_section_sp)
{
- return eObjC_V1;
+ return lldb::eAppleObjC_V1;
}
- return eObjC_V2;
+ return lldb::eAppleObjC_V2;
}
}
- return eObjC_VersionUnknown;
+ return lldb::eObjC_VersionUnknown;
}
//------------------------------------------------------------------
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
index aab0f348b5f..baf735da2a0 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
@@ -27,12 +27,6 @@ class AppleObjCRuntime :
public lldb_private::ObjCLanguageRuntime
{
public:
-
- enum RuntimeVersions {
- eObjC_VersionUnknown = 0,
- eObjC_V1 = 1,
- eObjC_V2 = 2
- };
~AppleObjCRuntime() { }
@@ -73,7 +67,7 @@ protected:
static bool
AppleIsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
- static enum AppleObjCRuntime::RuntimeVersions
+ static enum lldb::ObjCRuntimeVersions
GetObjCVersion (Process *process, ModuleSP &objc_module_sp);
//------------------------------------------------------------------
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
index ce379fcebcf..a9203db8b3e 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
@@ -59,7 +59,7 @@ AppleObjCRuntimeV1::CreateInstance (Process *process, lldb::LanguageType languag
{
ModuleSP objc_module_sp;
- if (AppleObjCRuntime::GetObjCVersion (process, objc_module_sp) == AppleObjCRuntime::eObjC_V1)
+ if (AppleObjCRuntime::GetObjCVersion (process, objc_module_sp) == lldb::eAppleObjC_V1)
return new AppleObjCRuntimeV1 (process);
else
return NULL;
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
index e3b92a391bc..832a165b80b 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
@@ -64,6 +64,11 @@ public:
virtual void
SetExceptionBreakpoints ();
+ virtual lldb::ObjCRuntimeVersions
+ GetRuntimeVersion ()
+ {
+ return lldb::eAppleObjC_V1;
+ }
protected:
private:
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 00d8e786658..2ad83888ab3 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -65,7 +65,7 @@ AppleObjCRuntimeV2::CreateInstance (Process *process, lldb::LanguageType languag
{
ModuleSP objc_module_sp;
- if (AppleObjCRuntime::GetObjCVersion (process, objc_module_sp) == AppleObjCRuntime::eObjC_V2)
+ if (AppleObjCRuntime::GetObjCVersion (process, objc_module_sp) == lldb::eAppleObjC_V2)
return new AppleObjCRuntimeV2 (process, objc_module_sp);
else
return NULL;
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
index 010aa010cb2..e4bb556afd1 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
@@ -64,6 +64,12 @@ public:
virtual void
SetExceptionBreakpoints ();
+
+ virtual lldb::ObjCRuntimeVersions
+ GetRuntimeVersion ()
+ {
+ return lldb::eAppleObjC_V2;
+ }
protected:
OpenPOWER on IntegriCloud