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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 cmd += ['|', os.path.join(llvm_bin_path, 'llvm-mc'), | 114 cmd += ['|', os.path.join(llvm_bin_path, 'llvm-mc'), |
115 # TODO(stichnot): -triple=i686-nacl should be used for a | 115 # TODO(stichnot): -triple=i686-nacl should be used for a |
116 # sandboxing test. This means there should be an args.sandbox | 116 # sandboxing test. This means there should be an args.sandbox |
117 # argument that also gets passed through to pnacl-sz. | 117 # argument that also gets passed through to pnacl-sz. |
118 '-triple=i686', | 118 '-triple=i686', |
119 '-filetype=obj', '-o', asm_temp.name] | 119 '-filetype=obj', '-o', asm_temp.name] |
120 elif asm_temp: | 120 elif asm_temp: |
121 cmd += ['-o', asm_temp.name] | 121 cmd += ['-o', asm_temp.name] |
122 if args.disassemble: | 122 if args.disassemble: |
123 # Show wide instruction encodings, diassemble, and show relocs. | 123 # Show wide instruction encodings, diassemble, and show relocs. |
124 cmd += (['&&', os.path.join(binutils_bin_path, 'objdump')] + | 124 cmd += (['&&', os.path.join(binutils_bin_path, 'le32-nacl-objdump')] + |
125 args.dis_flags + | 125 args.dis_flags + |
126 ['-w', '-d', '-r', '-Mintel', asm_temp.name]) | 126 ['-w', '-d', '-r', '-Mintel', asm_temp.name]) |
127 | 127 |
128 stdout_result = shellcmd(cmd, echo=args.echo_cmd) | 128 stdout_result = shellcmd(cmd, echo=args.echo_cmd) |
129 if not args.echo_cmd: | 129 if not args.echo_cmd: |
130 sys.stdout.write(stdout_result) | 130 sys.stdout.write(stdout_result) |
131 if asm_temp: | 131 if asm_temp: |
132 os.remove(asm_temp.name) | 132 os.remove(asm_temp.name) |
133 | 133 |
134 if __name__ == '__main__': | 134 if __name__ == '__main__': |
135 main() | 135 main() |
OLD | NEW |