Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python2 | 1 #!/usr/bin/env python2 |
| 2 | 2 |
| 3 import argparse | 3 import argparse |
| 4 import itertools | 4 import itertools |
| 5 import os | 5 import os |
| 6 import re | 6 import re |
| 7 import subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 import tempfile | 9 import tempfile |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 asm_temp.close() | 189 asm_temp.close() |
| 190 output_file_name = asm_temp.name | 190 output_file_name = asm_temp.name |
| 191 if args.assemble and args.filetype != 'obj': | 191 if args.assemble and args.filetype != 'obj': |
| 192 cmd += (['|', os.path.join(pnacl_bin_path, 'llvm-mc')] + | 192 cmd += (['|', os.path.join(pnacl_bin_path, 'llvm-mc')] + |
| 193 TargetAssemblerFlags(args.target, args.sandbox) + | 193 TargetAssemblerFlags(args.target, args.sandbox) + |
| 194 ['-filetype=obj', '-o', output_file_name]) | 194 ['-filetype=obj', '-o', output_file_name]) |
| 195 elif output_file_name: | 195 elif output_file_name: |
| 196 cmd += ['-o', output_file_name] | 196 cmd += ['-o', output_file_name] |
| 197 if args.disassemble: | 197 if args.disassemble: |
| 198 # Show wide instruction encodings, diassemble, and show relocs. | 198 # Show wide instruction encodings, diassemble, and show relocs. |
| 199 cmd += (['&&', os.path.join(pnacl_bin_path, 'le32-nacl-objdump')] + | 199 cmd += (['&&', os.path.join(pnacl_bin_path, 'arm-nacl-objdump')] + |
|
Jim Stichnoth
2016/03/09 14:38:04
IIRC, originally the tests used the system objdump
Sean Klein
2016/03/09 18:27:44
Yeah, I agree that it's not very intuitive that "a
| |
| 200 args.dis_flags + | 200 args.dis_flags + |
| 201 ['-w', '-d', '-r'] + TargetDisassemblerFlags(args.target) + | 201 ['-w', '-d', '-r'] + TargetDisassemblerFlags(args.target) + |
| 202 [output_file_name]) | 202 [output_file_name]) |
| 203 | 203 |
| 204 stdout_result = shellcmd(cmd, echo=args.echo_cmd) | 204 stdout_result = shellcmd(cmd, echo=args.echo_cmd) |
| 205 if not args.echo_cmd: | 205 if not args.echo_cmd: |
| 206 sys.stdout.write(stdout_result) | 206 sys.stdout.write(stdout_result) |
| 207 if asm_temp and not keep_output_file: | 207 if asm_temp and not keep_output_file: |
| 208 os.remove(output_file_name) | 208 os.remove(output_file_name) |
| 209 | 209 |
| 210 if __name__ == '__main__': | 210 if __name__ == '__main__': |
| 211 main() | 211 main() |
| OLD | NEW |