OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (C) 2013 The Android Open Source Project | 3 # Copyright (C) 2013 The Android Open Source Project |
4 # | 4 # |
5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
8 # | 8 # |
9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
10 # | 10 # |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 ] | 141 ] |
142 else: | 142 else: |
143 known_toolchains = [] | 143 known_toolchains = [] |
144 | 144 |
145 logging.debug('FindToolcahin: known_toolchains=%s' % known_toolchains) | 145 logging.debug('FindToolcahin: known_toolchains=%s' % known_toolchains) |
146 # Look for addr2line to check for valid toolchain path. | 146 # Look for addr2line to check for valid toolchain path. |
147 for (label, platform, target) in known_toolchains: | 147 for (label, platform, target) in known_toolchains: |
148 toolchain_info = (label, platform, target); | 148 toolchain_info = (label, platform, target); |
149 if os.path.exists(ToolPath("addr2line", toolchain_info)): | 149 if os.path.exists(ToolPath("addr2line", toolchain_info)): |
150 TOOLCHAIN_INFO = toolchain_info | 150 TOOLCHAIN_INFO = toolchain_info |
151 print "Using toolchain from :" + ToolPath("", TOOLCHAIN_INFO) | 151 print ("Using toolchain from: " |
| 152 + os.path.normpath(ToolPath("", TOOLCHAIN_INFO))) |
152 return toolchain_info | 153 return toolchain_info |
153 | 154 |
154 raise Exception("Could not find tool chain") | 155 raise Exception("Could not find tool chain") |
155 | 156 |
156 def GetAapt(): | 157 def GetAapt(): |
157 """Returns the path to aapt. | 158 """Returns the path to aapt. |
158 | 159 |
159 Args: | 160 Args: |
160 None | 161 None |
161 | 162 |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 process.stdin.write("\n") | 606 process.stdin.write("\n") |
606 process.stdin.close() | 607 process.stdin.close() |
607 demangled_symbol = process.stdout.readline().strip() | 608 demangled_symbol = process.stdout.readline().strip() |
608 process.stdout.close() | 609 process.stdout.close() |
609 return demangled_symbol | 610 return demangled_symbol |
610 | 611 |
611 def FormatSymbolWithOffset(symbol, offset): | 612 def FormatSymbolWithOffset(symbol, offset): |
612 if offset == 0: | 613 if offset == 0: |
613 return symbol | 614 return symbol |
614 return "%s+%d" % (symbol, offset) | 615 return "%s+%d" % (symbol, offset) |
OLD | NEW |