MCPcopy Create free account
hub / github.com/catboost/catboost / resolve_addresses

Function resolve_addresses

library/python/cores/__init__.py:214–231  ·  view source on GitHub ↗
(addresses, symbolizer, binary)

Source from the content-addressed store, hash-verified

212
213
214def resolve_addresses(addresses, symbolizer, binary):
215 addresses = list(set(addresses))
216 cmd = [
217 symbolizer,
218 "--demangle",
219 "--obj",
220 binary,
221 ]
222 proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **({'text': True} if six.PY3 else {}))
223 out, err = proc.communicate(input="\n".join(addresses))
224 if proc.returncode:
225 raise Exception("Symbolizer failed with rc:{}\nstderr: {}".format(proc.returncode, err))
226
227 resolved = list(filter(None, out.split("\n\n")))
228 if len(addresses) != len(resolved):
229 raise Exception("llvm-symbolizer can not extract lines from addresses (count mismatch: {}-{})".format(len(addresses), len(resolved)))
230
231 return {k: v.strip(" \n") for k, v in zip(addresses, resolved)}

Callers

nothing calls this directly

Calls 7

filterClass · 0.85
lenFunction · 0.85
listClass · 0.50
setFunction · 0.50
joinMethod · 0.45
formatMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected