summaryrefslogtreecommitdiffstats
path: root/tools/cygprofile/symbol_extractor.py
diff options
context:
space:
mode:
authorpcc <pcc@chromium.org>2015-11-25 17:08:37 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-26 01:10:34 +0000
commit2dacf7decbc26266d695943b4bc4a57c37429e58 (patch)
tree7132698d6bf7d3cbd33c82f3b9a820780fe0d679 /tools/cygprofile/symbol_extractor.py
parent94833c007d0ba7f4814df63739fd062ba49d6523 (diff)
downloadchromium_src-2dacf7decbc26266d695943b4bc4a57c37429e58.zip
chromium_src-2dacf7decbc26266d695943b4bc4a57c37429e58.tar.gz
chromium_src-2dacf7decbc26266d695943b4bc4a57c37429e58.tar.bz2
cygprofile: Allow $ character in symbol names.
Clang's symbol names sometimes contain the $ character, which we previously disallowed. We continue to forbid the $ character at the start of the symbol name, as these are ARM mapping symbols [1] which should not appear in our orderfile. At the same time, fix an issue where an exception can cause a deadlock when waiting for the objdump process by closing stdout before waiting on it. [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0474f/CHDGFCDI.html BUG=539408 R=pasko@chromium.org Review URL: https://codereview.chromium.org/1458853004 Cr-Commit-Position: refs/heads/master@{#361779}
Diffstat (limited to 'tools/cygprofile/symbol_extractor.py')
-rwxr-xr-xtools/cygprofile/symbol_extractor.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/cygprofile/symbol_extractor.py b/tools/cygprofile/symbol_extractor.py
index d709117..452548e 100755
--- a/tools/cygprofile/symbol_extractor.py
+++ b/tools/cygprofile/symbol_extractor.py
@@ -54,7 +54,13 @@ def _FromObjdumpLine(line):
section = parts[3]
size = int(parts[4], 16)
name = parts[-1].rstrip('\n')
- assert re.match('^[a-zA-Z0-9_.]+$', name)
+ # Forbid ARM mapping symbols and other unexpected symbol names, but allow $
+ # characters in a non-initial position, which can appear as a component of a
+ # mangled name, e.g. Clang can mangle a lambda function to:
+ # 02cd61e0 l F .text 000000c0 _ZZL11get_globalsvENK3$_1clEv
+ # The equivalent objdump line from GCC is:
+ # 0325c58c l F .text 000000d0 _ZZL11get_globalsvENKUlvE_clEv
+ assert re.match('^[a-zA-Z0-9_.][a-zA-Z0-9_.$]*$', name)
return SymbolInfo(name=name, offset=offset, section=section, size=size)
@@ -90,6 +96,7 @@ def SymbolInfosFromBinary(binary_filename):
result = _SymbolInfosFromStream(p.stdout)
return result
finally:
+ p.stdout.close()
p.wait()