aboutsummaryrefslogtreecommitdiff
path: root/lldb/scripts/Python/modify-python-lldb.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-09-24 04:51:43 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-09-24 04:51:43 +0000
commit5b94dc28b3f3ee939a871eb6583372244a44217f (patch)
tree2acab433556ea758f3ed6718e6ec0ce3c43f4591 /lldb/scripts/Python/modify-python-lldb.py
parent1f88d2f53103f68cc13dcf6f0d98e33dc60458ab (diff)
downloadllvm-5b94dc28b3f3ee939a871eb6583372244a44217f.zip
llvm-5b94dc28b3f3ee939a871eb6583372244a44217f.tar.gz
llvm-5b94dc28b3f3ee939a871eb6583372244a44217f.tar.bz2
SBSection supports iteration through its subsections, represented as SBSection as well.
SBModule supports an additional SBSection iteration, besides the original SBSymbol iteration. Add docstrings and implement the two SBSection iteration protocols. llvm-svn: 140449
Diffstat (limited to 'lldb/scripts/Python/modify-python-lldb.py')
-rw-r--r--lldb/scripts/Python/modify-python-lldb.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/scripts/Python/modify-python-lldb.py b/lldb/scripts/Python/modify-python-lldb.py
index 3825090..33929c6 100644
--- a/lldb/scripts/Python/modify-python-lldb.py
+++ b/lldb/scripts/Python/modify-python-lldb.py
@@ -150,6 +150,7 @@ linked_list_iter_def = '''
iter_def = " def __iter__(self): return lldb_iter(self, '%s', '%s')"
module_iter = " def module_iter(self): return lldb_iter(self, '%s', '%s')"
breakpoint_iter = " def breakpoint_iter(self): return lldb_iter(self, '%s', '%s')"
+section_iter = " def section_iter(self): return lldb_iter(self, '%s', '%s')"
# Called to implement the built-in function len().
# Eligible objects are those containers with unambiguous iteration support.
@@ -172,6 +173,7 @@ d = { 'SBBreakpoint': ('GetNumLocations', 'GetLocationAtIndex'),
'SBDebugger': ('GetNumTargets', 'GetTargetAtIndex'),
'SBModule': ('GetNumSymbols', 'GetSymbolAtIndex'),
'SBProcess': ('GetNumThreads', 'GetThreadAtIndex'),
+ 'SBSection': ('GetNumSubSections', 'GetSubSectionAtIndex'),
'SBThread': ('GetNumFrames', 'GetFrameAtIndex'),
'SBInstructionList': ('GetSize', 'GetInstructionAtIndex'),
@@ -186,7 +188,10 @@ d = { 'SBBreakpoint': ('GetNumLocations', 'GetLocationAtIndex'),
# SBTarget needs special processing, see below.
'SBTarget': {'module': ('GetNumModules', 'GetModuleAtIndex'),
'breakpoint': ('GetNumBreakpoints', 'GetBreakpointAtIndex')
- }
+ },
+
+ # SBModule has an additional section_iter(), see below.
+ 'SBModule-extra': ('GetNumSections', 'GetSectionAtIndex')
}
#
@@ -332,6 +337,9 @@ for line in content.splitlines():
new_content.add_line(eq_def % (cls, list_to_frag(e[cls])))
new_content.add_line(ne_def)
+ # SBModule has an extra SBSection iterator!
+ if cls == "SBModule":
+ new_content.add_line(section_iter % d[cls+'-extra'])
# This special purpose iterator is for SBValue only!!!
if cls == "SBValue":
new_content.add_line(linked_list_iter_def)