summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/module_section
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-09-28 00:51:00 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-09-28 00:51:00 +0000
commita32a13d207f97543348314989d446638a0c97aa9 (patch)
tree0e950307b41c40d5a772c0556b6c46775ff166ad /lldb/test/python_api/module_section
parentfe6fd36b6c0488b91b53ed2362d36ddb64775532 (diff)
downloadbcm5719-llvm-a32a13d207f97543348314989d446638a0c97aa9.tar.gz
bcm5719-llvm-a32a13d207f97543348314989d446638a0c97aa9.zip
Add a test sequence of iterating through a module's symbols belonging to a section.
Add the relevant utility functions to the lldbutil.py file. llvm-svn: 140669
Diffstat (limited to 'lldb/test/python_api/module_section')
-rw-r--r--lldb/test/python_api/module_section/TestModuleAndSection.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/test/python_api/module_section/TestModuleAndSection.py b/lldb/test/python_api/module_section/TestModuleAndSection.py
index 98a8d08ef05..66f46b8bc97 100644
--- a/lldb/test/python_api/module_section/TestModuleAndSection.py
+++ b/lldb/test/python_api/module_section/TestModuleAndSection.py
@@ -7,6 +7,7 @@ import re
import unittest2
import lldb
from lldbtest import *
+from lldbutil import symbol_iter, symbol_type_to_str
class ModuleAndSectionAPIsTestCase(TestBase):
@@ -39,12 +40,17 @@ class ModuleAndSectionAPIsTestCase(TestBase):
print "Exe module: %s" % repr(exe_module)
print "Number of sections: %d" % exe_module.GetNumSections()
INDENT = ' ' * 4
+ INDENT2 = INDENT * 2
for sec in exe_module.section_iter():
print sec
if sec.GetName() == "__TEXT":
print INDENT + "Number of subsections: %d" % sec.GetNumSubSections()
for subsec in sec:
print INDENT + repr(subsec)
+ # Now print the symbols belonging to the subsection....
+ for sym in symbol_iter(exe_module, subsec):
+ print INDENT2 + repr(sym)
+ print INDENT2 + "symbol type: %s" % symbol_type_to_str(sym.GetType())
if __name__ == '__main__':
OpenPOWER on IntegriCloud