MCPcopy Create free account
hub / github.com/apache/thrift / get_address

Function get_address

contrib/parse_profiling.py:51–71  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

49
50
51def 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
74def translate_file_addresses(filename, addresses, options):

Callers 1

addFrameMethod · 0.85

Calls 1

AddressInfoClass · 0.85

Tested by

no test coverage detected