diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2011-10-06 22:48:56 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2011-10-06 22:48:56 +0000 |
| commit | e7e4ac4d8d330931ceb854932cb79cb300323329 (patch) | |
| tree | b8dc119775f1ac9efcd65a093b8064eafc5b3e59 /lldb/examples/python | |
| parent | 9b13d3dbe55a7924f5dae2f59fb2d181995c45e8 (diff) | |
| download | bcm5719-llvm-e7e4ac4d8d330931ceb854932cb79cb300323329.tar.gz bcm5719-llvm-e7e4ac4d8d330931ceb854932cb79cb300323329.zip | |
Simplify code to print symbols and sections within a module using the built-in iterators.
llvm-svn: 141326
Diffstat (limited to 'lldb/examples/python')
| -rwxr-xr-x | lldb/examples/python/symbolicate-crash.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lldb/examples/python/symbolicate-crash.py b/lldb/examples/python/symbolicate-crash.py index c7972abec9d..8b315d4e771 100755 --- a/lldb/examples/python/symbolicate-crash.py +++ b/lldb/examples/python/symbolicate-crash.py @@ -278,17 +278,12 @@ def print_module_section (section, depth): 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" |

