Mercurial > hg > CbC > CbC_llvm
comparison lldb/examples/python/sources.py @ 252:1f2b6ac9f198 llvm-original
LLVM16-1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Aug 2023 09:04:13 +0900 |
parents | c4bab56944e8 |
children |
comparison
equal
deleted
inserted
replaced
237:c80f45b162ad | 252:1f2b6ac9f198 |
---|---|
11 if compile_unit.file: | 11 if compile_unit.file: |
12 print(" %s" % (compile_unit.file), file=result) | 12 print(" %s" % (compile_unit.file), file=result) |
13 | 13 |
14 | 14 |
15 def info_sources(debugger, command, result, dict): | 15 def info_sources(debugger, command, result, dict): |
16 description = '''This command will dump all compile units in any modules that are listed as arguments, or for all modules if no arguments are supplied.''' | 16 description = """This command will dump all compile units in any modules that are listed as arguments, or for all modules if no arguments are supplied.""" |
17 module_names = shlex.split(command) | 17 module_names = shlex.split(command) |
18 target = debugger.GetSelectedTarget() | 18 target = debugger.GetSelectedTarget() |
19 if module_names: | 19 if module_names: |
20 for module_name in module_names: | 20 for module_name in module_names: |
21 dump_module_sources(target.module[module_name], result) | 21 dump_module_sources(target.module[module_name], result) |
24 dump_module_sources(module, result) | 24 dump_module_sources(module, result) |
25 | 25 |
26 | 26 |
27 def __lldb_init_module(debugger, dict): | 27 def __lldb_init_module(debugger, dict): |
28 # Add any commands contained in this module to LLDB | 28 # Add any commands contained in this module to LLDB |
29 debugger.HandleCommand( | 29 debugger.HandleCommand("command script add -o -f sources.info_sources info_sources") |
30 'command script add -f sources.info_sources info_sources') | 30 print( |
31 print('The "info_sources" command has been installed, type "help info_sources" or "info_sources --help" for detailed help.') | 31 'The "info_sources" command has been installed, type "help info_sources" or "info_sources --help" for detailed help.' |
32 ) |