From a8f08dc5da8f940b6172b27f523e8369ee22817a Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 29 Jun 2017 12:54:13 +1000 Subject: [PATCH] make size: Fix map file parsing error on Windows Closes https://github.com/espressif/esp-idf/issues/739 --- tools/idf_size.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/idf_size.py b/tools/idf_size.py index 1116af362e..aa1d767599 100755 --- a/tools/idf_size.py +++ b/tools/idf_size.py @@ -57,12 +57,12 @@ def load_memory_config(map_file): """ Memory Configuration section is the total size of each output section """ result = {} scan_to_header(map_file, "Memory Configuration") - RE_MEMORY_SECTION = r"(?P[^ ]+) +0x(?P[\da-f]+) 0x(?P[\da-f]+)" + RE_MEMORY_SECTION = r"(?P[^ ]+) +0x(?P[\da-f]+) +0x(?P[\da-f]+)" for line in map_file: m = re.match(RE_MEMORY_SECTION, line) if m is None: if len(result) == 0: - continue # whitespace or a header + continue # whitespace or a header, before the content we want else: return result # we're at the end of the Memory Configuration section = { @@ -72,6 +72,7 @@ def load_memory_config(map_file): } if section["name"] != "*default*": result[section["name"]] = section + raise RuntimeError("End of file while scanning memory configuration?") def load_sections(map_file): """ Load section size information from the MAP file.