[Lldb-commits] [lldb] r140710 - in /lldb/trunk/test: lldbutil.py python_api/module_section/TestModuleAndSection.py

Johnny Chen johnny.chen at apple.com
Wed Sep 28 11:33:50 PDT 2011


Author: johnny
Date: Wed Sep 28 13:33:50 2011
New Revision: 140710

URL: http://llvm.org/viewvc/llvm-project?rev=140710&view=rev
Log:
Modify lldbutil.in_range(symbol, section) to deal with the symbol whose
end address is an LLDB_INVALID_ADDRESS.  Modify the test case to dump
all the symbols in all the sections.

Modified:
    lldb/trunk/test/lldbutil.py
    lldb/trunk/test/python_api/module_section/TestModuleAndSection.py

Modified: lldb/trunk/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=140710&r1=140709&r2=140710&view=diff
==============================================================================
--- lldb/trunk/test/lldbutil.py (original)
+++ lldb/trunk/test/lldbutil.py Wed Sep 28 13:33:50 2011
@@ -53,10 +53,17 @@
     symEA = symbol.GetEndAddress().GetFileAddress()
     secSA = section.GetFileAddress()
     secEA = secSA + section.GetByteSize()
-    if (secSA <= symSA and symEA < secEA):
-        return True
+
+    if symEA != lldb.LLDB_INVALID_ADDRESS:
+        if secSA <= symSA and symEA <= secEA:
+            return True
+        else:
+            return False
     else:
-        return False
+        if secSA <= symSA and symSA < secEA:
+            return True
+        else:
+            return False
 
 def symbol_iter(module, section):
     """Given a module and its contained section, returns an iterator on the

Modified: lldb/trunk/test/python_api/module_section/TestModuleAndSection.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/module_section/TestModuleAndSection.py?rev=140710&r1=140709&r2=140710&view=diff
==============================================================================
--- lldb/trunk/test/python_api/module_section/TestModuleAndSection.py (original)
+++ lldb/trunk/test/python_api/module_section/TestModuleAndSection.py Wed Sep 28 13:33:50 2011
@@ -43,8 +43,12 @@
         INDENT2 = INDENT * 2
         for sec in exe_module.section_iter():
             print sec
-            if sec.GetName() == "__TEXT":
-                print INDENT + "Number of subsections: %d" % sec.GetNumSubSections()
+            print INDENT + "Number of subsections: %d" % sec.GetNumSubSections()
+            if sec.GetNumSubSections() == 0:
+                for sym in symbol_iter(exe_module, sec):
+                    print INDENT + repr(sym)
+                    print INDENT + "symbol type: %s" % symbol_type_to_str(sym.GetType())
+            else:
                 for subsec in sec:
                     print INDENT + repr(subsec)
                     # Now print the symbols belonging to the subsection....





More information about the lldb-commits mailing list