[Lldb-commits] [lldb] r123693 - in /lldb/trunk: include/lldb/ include/lldb/Target/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/

Jim Ingham jingham at apple.com
Mon Jan 17 15:06:54 PST 2011


Author: jingham
Date: Mon Jan 17 17:06:54 2011
New Revision: 123693

URL: http://llvm.org/viewvc/llvm-project?rev=123693&view=rev
Log:
Add a method on the ObjC Language Runtime that returns the runtime version.

Modified:
    lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
    lldb/trunk/include/lldb/lldb-enumerations.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.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

Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=123693&r1=123692&r2=123693&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Mon Jan 17 17:06:54 2011
@@ -58,6 +58,12 @@
     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

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=123693&r1=123692&r2=123693&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Mon Jan 17 17:06:54 2011
@@ -633,6 +633,12 @@
     eExecutionTimedOut
 } ExecutionResults;
 
+typedef enum ObjCRuntimeVersions {
+    eObjC_VersionUnknown = 0,
+    eAppleObjC_V1 = 1,
+    eAppleObjC_V2 = 2
+} ObjCRuntimeVersions;
+
 } // namespace lldb
 
 

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=123693&r1=123692&r2=123693&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Mon Jan 17 17:06:54 2011
@@ -240,7 +240,7 @@
 //------------------------------------------------------------------
 // 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 @@
             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;
 }
 
 //------------------------------------------------------------------

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h?rev=123693&r1=123692&r2=123693&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h Mon Jan 17 17:06:54 2011
@@ -27,12 +27,6 @@
         public lldb_private::ObjCLanguageRuntime
 {
 public:
-
-    enum RuntimeVersions {
-        eObjC_VersionUnknown = 0,
-        eObjC_V1 = 1,
-        eObjC_V2 = 2
-    };
     
     ~AppleObjCRuntime() { }
     
@@ -73,7 +67,7 @@
     static bool
     AppleIsModuleObjCLibrary (const lldb::ModuleSP &module_sp);
 
-    static enum AppleObjCRuntime::RuntimeVersions
+    static enum lldb::ObjCRuntimeVersions
     GetObjCVersion (Process *process, ModuleSP &objc_module_sp);
 
     //------------------------------------------------------------------

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=123693&r1=123692&r2=123693&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp Mon Jan 17 17:06:54 2011
@@ -59,7 +59,7 @@
     {
         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;

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=123693&r1=123692&r2=123693&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h Mon Jan 17 17:06:54 2011
@@ -64,6 +64,11 @@
     virtual void
     SetExceptionBreakpoints ();
     
+    virtual lldb::ObjCRuntimeVersions
+    GetRuntimeVersion ()
+    {
+        return lldb::eAppleObjC_V1;
+    }
 protected:
     
 private:

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=123693&r1=123692&r2=123693&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Mon Jan 17 17:06:54 2011
@@ -65,7 +65,7 @@
     {
         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;

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=123693&r1=123692&r2=123693&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h Mon Jan 17 17:06:54 2011
@@ -64,6 +64,12 @@
     
     virtual void
     SetExceptionBreakpoints ();
+
+    virtual lldb::ObjCRuntimeVersions
+    GetRuntimeVersion ()
+    {
+        return lldb::eAppleObjC_V2;
+    }
     
 protected:
     





More information about the lldb-commits mailing list