Skip to content

Commit 50ceca7

Browse files
theotherjimmyadbridge
authored andcommitted
Handle multiple args per line in IAR cmd parser
1 parent fd800ca commit 50ceca7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tools/memap.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,16 +432,15 @@ def parse_iar_command_line(self, lines):
432432
for line in lines:
433433
if line.startswith("*"):
434434
break
435-
is_cmdline_file = RE_CMDLINE_FILE_IAR.match(line)
436-
if is_cmdline_file:
437-
full_path = is_cmdline_file.group(1)
438-
self.cmd_modules[os.path.basename(full_path)] = full_path
435+
for arg in line.split(" "):
436+
arg = arg.rstrip(" \n")
437+
if (not arg.startswith("-")) and arg.endswith(".o"):
438+
self.cmd_modules[os.path.basename(arg)] = arg
439439

440440
common_prefix = os.path.dirname(os.path.commonprefix(self.cmd_modules.values()))
441441
self.cmd_modules = {s: os.path.relpath(f, common_prefix)
442442
for s, f in self.cmd_modules.items()}
443443

444-
445444
def parse_map_file_iar(self, file_desc):
446445
""" Main logic to decode IAR map files
447446

0 commit comments

Comments
 (0)