[Lldb-commits] [lldb] r222189 - Add APIs on SBFunction and SBCompileUnit to inquire about the language type that the function/compile unit is defined in

Enrico Granata egranata at apple.com
Mon Nov 17 15:06:20 PST 2014


Author: enrico
Date: Mon Nov 17 17:06:20 2014
New Revision: 222189

URL: http://llvm.org/viewvc/llvm-project?rev=222189&view=rev
Log:
Add APIs on SBFunction and SBCompileUnit to inquire about the language type that the function/compile unit is defined in

Modified:
    lldb/trunk/include/lldb/API/SBCompileUnit.h
    lldb/trunk/include/lldb/API/SBFunction.h
    lldb/trunk/scripts/Python/interface/SBCompileUnit.i
    lldb/trunk/scripts/Python/interface/SBFunction.i
    lldb/trunk/source/API/SBCompileUnit.cpp
    lldb/trunk/source/API/SBFunction.cpp

Modified: lldb/trunk/include/lldb/API/SBCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBCompileUnit.h?rev=222189&r1=222188&r2=222189&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBCompileUnit.h (original)
+++ lldb/trunk/include/lldb/API/SBCompileUnit.h Mon Nov 17 17:06:20 2014
@@ -78,6 +78,9 @@ public:
     lldb::SBTypeList
     GetTypes (uint32_t type_mask = lldb::eTypeClassAny);
 
+    lldb::LanguageType
+    GetLanguage ();
+    
     bool
     operator == (const lldb::SBCompileUnit &rhs) const;
 

Modified: lldb/trunk/include/lldb/API/SBFunction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFunction.h?rev=222189&r1=222188&r2=222189&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBFunction.h (original)
+++ lldb/trunk/include/lldb/API/SBFunction.h Mon Nov 17 17:06:20 2014
@@ -58,6 +58,9 @@ public:
 
     lldb::SBBlock
     GetBlock ();
+    
+    lldb::LanguageType
+    GetLanguage ();
 
     bool
     operator == (const lldb::SBFunction &rhs) const;

Modified: lldb/trunk/scripts/Python/interface/SBCompileUnit.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBCompileUnit.i?rev=222189&r1=222188&r2=222189&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBCompileUnit.i (original)
+++ lldb/trunk/scripts/Python/interface/SBCompileUnit.i Mon Nov 17 17:06:20 2014
@@ -106,6 +106,9 @@ public:
     lldb::SBTypeList
     GetTypes (uint32_t type_mask = lldb::eTypeClassAny);
     
+     lldb::LanguageType
+     GetLanguage ();
+             
     bool
     GetDescription (lldb::SBStream &description);
     

Modified: lldb/trunk/scripts/Python/interface/SBFunction.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBFunction.i?rev=222189&r1=222188&r2=222189&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBFunction.i (original)
+++ lldb/trunk/scripts/Python/interface/SBFunction.i Mon Nov 17 17:06:20 2014
@@ -82,6 +82,9 @@ public:
 
     lldb::SBBlock
     GetBlock ();
+    
+    lldb::LanguageType
+    GetLanguage ();
 
     bool
     GetDescription (lldb::SBStream &description);

Modified: lldb/trunk/source/API/SBCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCompileUnit.cpp?rev=222189&r1=222188&r2=222189&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCompileUnit.cpp (original)
+++ lldb/trunk/source/API/SBCompileUnit.cpp Mon Nov 17 17:06:20 2014
@@ -228,6 +228,14 @@ SBCompileUnit::FindSupportFileIndex (uin
     return 0;
 }
 
+lldb::LanguageType
+SBCompileUnit::GetLanguage ()
+{
+    if (m_opaque_ptr)
+        return m_opaque_ptr->GetLanguage();
+    return lldb::eLanguageTypeUnknown;
+}
+
 bool
 SBCompileUnit::IsValid () const
 {

Modified: lldb/trunk/source/API/SBFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFunction.cpp?rev=222189&r1=222188&r2=222189&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFunction.cpp (original)
+++ lldb/trunk/source/API/SBFunction.cpp Mon Nov 17 17:06:20 2014
@@ -227,5 +227,15 @@ SBFunction::GetBlock ()
     return sb_block;
 }
 
+lldb::LanguageType
+SBFunction::GetLanguage ()
+{
+    if (m_opaque_ptr)
+    {
+        if (m_opaque_ptr->GetCompileUnit())
+            return m_opaque_ptr->GetCompileUnit()->GetLanguage();
+    }
+    return lldb::eLanguageTypeUnknown;
+}
 
 





More information about the lldb-commits mailing list