Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: tools/binary_size/linker_map_parser.py

Issue 2791433004: //tools/binary_size: source_path information, change file format, fixes (Closed)
Patch Set: fix comment for _DetectToolPrefix Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/binary_size/integration_test.py ('k') | tools/binary_size/map2size.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/linker_map_parser.py
diff --git a/tools/binary_size/linker_map_parser.py b/tools/binary_size/linker_map_parser.py
index ffb3803709a4e9f64087efff6d4ec5cc22169f7f..5cbb106648d23382067d22d3226080032c3ba701 100644
--- a/tools/binary_size/linker_map_parser.py
+++ b/tools/binary_size/linker_map_parser.py
@@ -24,7 +24,7 @@ class MapFileParser(object):
lines: Iterable of lines.
Returns:
- A SizeInfo object.
+ A tuple of (section_sizes, symbols).
"""
self._lines = iter(lines)
logging.info('Parsing common symbols')
@@ -32,8 +32,7 @@ class MapFileParser(object):
logging.debug('.bss common entries: %d', len(self._symbols))
logging.info('Parsing section symbols')
self._ParseSections()
- return models.SizeInfo(models.SymbolGroup(self._symbols),
- self._section_sizes)
+ return self._section_sizes, self._symbols
def _SkipToLineWithPrefix(self, prefix):
for l in self._lines:
@@ -67,7 +66,8 @@ class MapFileParser(object):
break
name, size_str, path = parts
self._symbols.append(
- models.Symbol('.bss', int(size_str[2:], 16), name=name, path=path))
+ models.Symbol('.bss', int(size_str[2:], 16), name=name,
+ object_path=path))
def _ParseSections(self):
# .text 0x0028c600 0x22d3468
@@ -141,7 +141,7 @@ class MapFileParser(object):
path = None
syms.append(
models.Symbol(section_name, size, address=address, name=name,
- path=path))
+ object_path=path))
else:
# A normal symbol entry.
subsection_name, address_str, size_str, path = (
@@ -189,7 +189,8 @@ class MapFileParser(object):
sym = models.Symbol(
section_name, merge_size,
address=merge_symbol_start_address,
- name='** symbol gap %d' % symbol_gap_count, path=path)
+ name='** symbol gap %d' % symbol_gap_count,
+ object_path=path)
symbol_gap_count += 1
syms.append(sym)
merge_symbol_start_address = 0
@@ -200,7 +201,8 @@ class MapFileParser(object):
if address == -1:
address = syms[-1].end_address
syms.append(models.Symbol(section_name, size, address=address,
- name=name or mangled_name, path=path))
+ name=name or mangled_name,
+ object_path=path))
logging.debug('Symbol count for %s: %d', section_name,
len(syms) - sym_count_at_start)
except:
« no previous file with comments | « tools/binary_size/integration_test.py ('k') | tools/binary_size/map2size.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698