Bug 1270091 - Handle missing function names. r=dminor

If the symbols file doesn't give a function name, substitute
'unnamed_function'. A more complete fix would be to catch
all ValueError exceptions and continue sensibly, but this
addresses the immediate issue with the output from `rustc -g`.

MozReview-Commit-ID: 666ruvLlJ5t
This commit is contained in:
Ralph Giles 2016-05-05 15:29:17 -07:00
parent 814c8dcc80
commit f123b681bb

View File

@ -43,7 +43,10 @@ class SymbolFile:
# http://code.google.com/p/google-breakpad/wiki/SymbolFiles
if line.startswith("FUNC "):
# FUNC <address> <size> <stack_param_size> <name>
(junk, rva, size, ss, name) = line.split(None, 4)
bits = line.split(None, 4)
if len(bits) < 5:
bits.append('unnamed_function')
(junk, rva, size, ss, name) = bits
rva = int(rva,16)
funcs[rva] = name
addrs.append(rva)