forked from espressif/esp-idf
tools/idf_size.py: Identify objects without extension in MAP files
This commit is contained in:
@@ -358,7 +358,10 @@ def load_sections(map_file): # type: (TextIO) -> Dict
|
||||
RE_FULL_LINE = re.compile(r'\s*(?P<sym_name>\S*) +0x(?P<address>[\da-f]+) +0x(?P<size>[\da-f]+)\s*(?P<file>.*)$')
|
||||
|
||||
# Extract archive and object_file from the file_info field
|
||||
RE_FILE = re.compile(r'((?P<archive>[^ ]+\.a)?\(?(?P<object_file>[^ ]+\.(o|obj))\)?)')
|
||||
# The object file extention (.obj or .o) is optional including the dot. This is necessary for some third-party
|
||||
# libraries. Since the dot is optional and the search gready the parsing of the object name must stop at ). Hence
|
||||
# the [^ )] part of the regex.
|
||||
RE_FILE = re.compile(r'((?P<archive>[^ ]+\.a)?\(?(?P<object_file>[^ )]+(\.(o|obj))?)\)?)')
|
||||
|
||||
def dump_src_line(src): # type: (Dict) -> str
|
||||
return '%s(%s) addr: 0x%08x, size: 0x%x+%d' % (src['sym_name'], src['file'], src['address'], src['size'], src['fill'])
|
||||
@@ -429,7 +432,7 @@ def load_sections(map_file): # type: (TextIO) -> Dict
|
||||
|
||||
# Extract archive and file information
|
||||
n = RE_FILE.match(m.group('file'))
|
||||
assert n
|
||||
assert n, 'Archive and file information not found for "{}"'.format(m.group('file'))
|
||||
|
||||
archive = n.group('archive')
|
||||
if archive is None:
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user