]> granicus.if.org Git - esp-idf/commitdiff
cmake: Fix idf_size.py merge errors
authorAngus Gratton <angus@espressif.com>
Tue, 1 May 2018 07:01:36 +0000 (17:01 +1000)
committerAngus Gratton <gus@projectgus.com>
Tue, 1 May 2018 07:27:39 +0000 (17:27 +1000)
tools/idf_size.py

index d67cfa25a513255a52344e5b8ec94e1e45f7cd5d..d207906b20e453eea4655bbfd6076ec704849ccb 100755 (executable)
@@ -102,12 +102,13 @@ def load_sections(map_file):
         # source file line, ie
         # 0x0000000040080400       0xa4 /home/gus/esp/32/idf/examples/get-started/hello_world/build/esp32/libesp32.a(cpu_start.o)
         RE_SOURCE_LINE = r"\s*(?P<sym_name>\S*).* +0x(?P<address>[\da-f]+) +0x(?P<size>[\da-f]+) (?P<archive>.+\.a)\((?P<object_file>.+\.ob?j?)\)"
-        m = re.match(RE_SOURCE_LINE, line)
+
+        m = re.match(RE_SOURCE_LINE, line, re.M)
         if not m:
             # cmake build system links some object files directly, not part of any archive
-            RE_SOURCE_LINE = r".*? +0x(?P<address>[\da-f]+) +0x(?P<size>[\da-f]+) (?P<object_file>.+\.ob?j?)"
+            RE_SOURCE_LINE = r"\s*(?P<sym_name>\S*).* +0x(?P<address>[\da-f]+) +0x(?P<size>[\da-f]+) (?P<object_file>.+\.ob?j?)"
             m = re.match(RE_SOURCE_LINE, line)
-        if section is not None and m is not None:  # input source file details
+        if section is not None and m is not None:  # input source file details=ma,e
             sym_name = m.group("sym_name") if len(m.group("sym_name")) > 0 else sym_backup
             try:
                 archive = m.group("archive")
@@ -117,7 +118,7 @@ def load_sections(map_file):
             source = {
                 "size" : int(m.group("size"), 16),
                 "address" : int(m.group("address"), 16),
-                "archive" : os.path.basename(archive)),
+                "archive" : os.path.basename(archive),
                 "object_file" : os.path.basename(m.group("object_file")),
                 "sym_name" : sym_name,
             }