[Lldb-commits] [lldb] r141326 - /lldb/trunk/examples/python/symbolicate-crash.py
Johnny Chen
johnny.chen at apple.com
Thu Oct 6 15:48:56 PDT 2011
Author: johnny
Date: Thu Oct 6 17:48:56 2011
New Revision: 141326
URL: http://llvm.org/viewvc/llvm-project?rev=141326&view=rev
Log:
Simplify code to print symbols and sections within a module using the built-in iterators.
Modified:
lldb/trunk/examples/python/symbolicate-crash.py
Modified: lldb/trunk/examples/python/symbolicate-crash.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/symbolicate-crash.py?rev=141326&r1=141325&r2=141326&view=diff
==============================================================================
--- lldb/trunk/examples/python/symbolicate-crash.py (original)
+++ lldb/trunk/examples/python/symbolicate-crash.py Thu Oct 6 17:48:56 2011
@@ -278,17 +278,12 @@
print_module_section (section.GetSubSectionAtIndex(sect_idx), depth - 1)
def print_module_sections (module, depth):
- num_sections = module.GetNumSections()
-
- for sect_idx in range(num_sections):
- section = module.GetSectionAtIndex(sect_idx)
- print_module_section (section, depth)
+ for sect in module.section_iter():
+ print_module_section (sect, depth)
def print_module_symbols (module):
- n = module.GetNumSymbols()
-
- for i in range(n):
- print module.GetSymbolAtIndex(i)
+ for sym in module:
+ print sym
def usage():
print "Usage: lldb-symbolicate.py [-n name] executable-image"
More information about the lldb-commits
mailing list