Retrieve an AddressInfo object for the specified object file and address. Keeps a global list of AddressInfo objects. Two calls to get_address() with the same filename and address will always return the same AddressInfo object.
(filename, address)
| 49 | |
| 50 | |
| 51 | def get_address(filename, address): |
| 52 | """ |
| 53 | Retrieve an AddressInfo object for the specified object file and address. |
| 54 | |
| 55 | Keeps a global list of AddressInfo objects. Two calls to get_address() |
| 56 | with the same filename and address will always return the same AddressInfo |
| 57 | object. |
| 58 | """ |
| 59 | global g_addrs_by_filename |
| 60 | try: |
| 61 | by_address = g_addrs_by_filename[filename] |
| 62 | except KeyError: |
| 63 | by_address = {} |
| 64 | g_addrs_by_filename[filename] = by_address |
| 65 | |
| 66 | try: |
| 67 | addr_info = by_address[address] |
| 68 | except KeyError: |
| 69 | addr_info = AddressInfo(filename, address) |
| 70 | by_address[address] = addr_info |
| 71 | return addr_info |
| 72 | |
| 73 | |
| 74 | def translate_file_addresses(filename, addresses, options): |