OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """A simple tool for making objdump's disassemble dumps | 6 """A simple tool for making objdump's disassemble dumps |
7 for arm more canonical. | 7 for arm more canonical. |
8 If two binaries have been generated with an almost identical code | 8 If two binaries have been generated with an almost identical code |
9 generator, we expect the delta of the canoncalized dumps to be small | 9 generator, we expect the delta of the canoncalized dumps to be small |
10 as well. | 10 as well. |
11 """ | 11 """ |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 # 1c: bl <__register_frame_info> | 51 # 1c: bl <__register_frame_info> |
52 fr = r"[0-9a-f]+(\s+" + opcode + r"\s+)[0-9a-f]+" | 52 fr = r"[0-9a-f]+(\s+" + opcode + r"\s+)[0-9a-f]+" |
53 to = r" \1" | 53 to = r" \1" |
54 line = re.sub(fr, to, line) | 54 line = re.sub(fr, to, line) |
55 # replace the address which was stripped out above by an offset | 55 # replace the address which was stripped out above by an offset |
56 print "%8x" % count, line, | 56 print "%8x" % count, line, |
57 count += 4 | 57 count += 4 |
58 else: | 58 else: |
59 # pass thru everything which is neither function beginning or instruction | 59 # pass thru everything which is neither function beginning or instruction |
60 print line, | 60 print line, |
OLD | NEW |