4"""Common utilities for tools that deal with binary size information.
12 """Parse nm output, returning data for all relevant (to binary size)
13 symbols and ignoring the rest.
16 nm_lines: an iterable over lines of nm output.
19 (symbol name, symbol type, symbol size, source file path).
21 Path may be
None if nm couldn
't figure out the source file.
25 sym_re = re.compile(
r'^([0-9a-f]{8,}) '
29 '(?:\t(.*):[\d\?]+)?.*$')
31 addr_re = re.compile(
r'^[0-9a-f]{8,} (.) ([^\t]+)(?:\t.*)?$')
33 noaddr_re = re.compile(
r'^ {8,} (.) (.*)$')
35 addr_only_re = re.compile(
r'^[0-9a-f]{8,} (.)$')
40 if line
in seen_lines:
45 match = sym_re.match(line)
47 address, size, sym_type, sym = match.groups()[0:4]
49 if sym_type
in (
'B',
'b'):
52 yield sym, sym_type, size, path, address
54 match = addr_re.match(line)
58 match = noaddr_re.match(line)
60 sym_type, sym = match.groups()
61 if sym_type
in (
'U',
'w'):
63 match = addr_only_re.match(line)
69 logging.warning(
'nm output parser failed to parse: %s', repr(line))
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set