[Lldb-commits] [lldb] r153893 - in /lldb/trunk: include/lldb/API/SBSymbol.h scripts/Python/interface/SBSymbol.i source/API/SBSymbol.cpp

Greg Clayton gclayton at apple.com
Mon Apr 2 13:08:08 PDT 2012


Author: gclayton
Date: Mon Apr  2 15:08:08 2012
New Revision: 153893

URL: http://llvm.org/viewvc/llvm-project?rev=153893&view=rev
Log:
Export the ability to see if a symbol is externally visible and also if the symbol was synthetically added to the symbol table (the symbol was not part of the symbol table itself but came from another section).


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

Modified: lldb/trunk/include/lldb/API/SBSymbol.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBSymbol.h?rev=153893&r1=153892&r2=153893&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBSymbol.h (original)
+++ lldb/trunk/include/lldb/API/SBSymbol.h Mon Apr  2 15:08:08 2012
@@ -64,6 +64,20 @@
     bool
     GetDescription (lldb::SBStream &description);
 
+    //----------------------------------------------------------------------
+    // Returns true if the symbol is externally visible in the module that
+    // it is defined in
+    //----------------------------------------------------------------------
+    bool
+    IsExternal();
+
+    //----------------------------------------------------------------------
+    // Returns true if the symbol was synthetically generated from something
+    // other than the actual symbol table itself in the object file.
+    //----------------------------------------------------------------------
+    bool
+    IsSynthetic();
+
 protected:
 
     lldb_private::Symbol *

Modified: lldb/trunk/scripts/Python/interface/SBSymbol.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBSymbol.i?rev=153893&r1=153892&r2=153893&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBSymbol.i (original)
+++ lldb/trunk/scripts/Python/interface/SBSymbol.i Mon Apr  2 15:08:08 2012
@@ -52,7 +52,13 @@
 
     bool
     GetDescription (lldb::SBStream &description);
-    
+
+    bool
+    IsExternal();
+
+    bool
+    IsSynthetic();
+
     %pythoncode %{
         def get_instructions_from_current_target (self):
             return self.GetInstructions (target)
@@ -77,6 +83,13 @@
         
         __swig_getmethods__["instructions"] = get_instructions_from_current_target
         if _newclass: x = property(get_instructions_from_current_target, None)
+
+        __swig_getmethods__["external"] = IsExternal
+        if _newclass: x = property(IsExternal, None)
+
+        __swig_getmethods__["synthetic"] = IsSynthetic
+        if _newclass: x = property(IsSynthetic, None)
+
         
     %}
 

Modified: lldb/trunk/source/API/SBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbol.cpp?rev=153893&r1=153892&r2=153893&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbol.cpp (original)
+++ lldb/trunk/source/API/SBSymbol.cpp Mon Apr  2 15:08:08 2012
@@ -199,3 +199,20 @@
         return m_opaque_ptr->GetType();
     return eSymbolTypeInvalid;
 }
+
+bool
+SBSymbol::IsExternal()
+{
+    if (m_opaque_ptr)
+        return m_opaque_ptr->IsExternal();
+    return false;
+}
+
+bool
+SBSymbol::IsSynthetic()
+{
+    if (m_opaque_ptr)
+        return m_opaque_ptr->IsSynthetic();
+    return false;
+}
+





More information about the lldb-commits mailing list