Merge "Handle IOExceptions if addr2line fails." am: 9a192cd10b am: 636042a889
am: 7d17c32a1a
Change-Id: I3b48ff8671e6e73e1c423ec9e54b6fea9edc72c0
This commit is contained in:
@@ -297,26 +297,30 @@ def CallAddr2LineForSet(lib, unique_addrs):
|
|||||||
child = _PIPE_ADDR2LINE_CACHE.GetProcess(cmd)
|
child = _PIPE_ADDR2LINE_CACHE.GetProcess(cmd)
|
||||||
|
|
||||||
for addr in addrs:
|
for addr in addrs:
|
||||||
child.stdin.write("0x%s\n" % addr)
|
try:
|
||||||
child.stdin.flush()
|
child.stdin.write("0x%s\n" % addr)
|
||||||
records = []
|
child.stdin.flush()
|
||||||
first = True
|
records = []
|
||||||
while True:
|
first = True
|
||||||
symbol = child.stdout.readline().strip()
|
while True:
|
||||||
if symbol == "??":
|
symbol = child.stdout.readline().strip()
|
||||||
symbol = None
|
if symbol == "??":
|
||||||
location = child.stdout.readline().strip()
|
symbol = None
|
||||||
if location == "??:0" or location == "??:?":
|
location = child.stdout.readline().strip()
|
||||||
location = None
|
if location == "??:0" or location == "??:?":
|
||||||
if symbol is None and location is None:
|
location = None
|
||||||
break
|
if symbol is None and location is None:
|
||||||
records.append((symbol, location))
|
break
|
||||||
if first:
|
records.append((symbol, location))
|
||||||
# Write a blank line as a sentinel so we know when to stop
|
if first:
|
||||||
# reading inlines from the output.
|
# Write a blank line as a sentinel so we know when to stop
|
||||||
# The blank line will cause addr2line to emit "??\n??:0\n".
|
# reading inlines from the output.
|
||||||
child.stdin.write("\n")
|
# The blank line will cause addr2line to emit "??\n??:0\n".
|
||||||
first = False
|
child.stdin.write("\n")
|
||||||
|
first = False
|
||||||
|
except IOError as e:
|
||||||
|
# Remove the / in front of the library name to match other output.
|
||||||
|
records = [(None, lib[1:] + " ***Error: " + str(e))]
|
||||||
result[addr] = records
|
result[addr] = records
|
||||||
addr_cache[addr] = records
|
addr_cache[addr] = records
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user