@@ -342,28 +342,23 @@ def parse_map_file_iar(self, file_desc):
342
342
else :
343
343
self .module_add (name , size , section )
344
344
345
- def search_objects (self , path , toolchain ):
346
- """ Check whether the specified map file matches with the toolchain.
347
- Searches for object files and creates mapping: object --> module
345
+ def search_objects (self , path ):
346
+ """ Searches for object files and creates mapping: object --> module
348
347
349
348
Positional arguments:
350
349
path - the path to an object file
351
- toolchain - the toolchain used to build the object file
352
350
"""
353
351
354
352
path = path .replace ('\\ ' , '/' )
355
353
356
354
# check location of map file
357
- rex = r'^(.+\/)' + re . escape ( toolchain ) + r'\/(.+\.map)$'
355
+ rex = r'^(.+)' + r'\/(.+\.map)$'
358
356
test_rex = re .match (rex , path )
359
357
360
358
if test_rex :
361
- search_path = test_rex .group (1 ) + toolchain + '/mbed-os/'
359
+ search_path = test_rex .group (1 ) + '/mbed-os/'
362
360
else :
363
- # It looks this is not an mbed project
364
- # object-to-module mapping cannot be generated
365
- print "Warning: specified toolchain doesn't match with" \
366
- " path to the memory map file."
361
+ print "Warning: this doesn't look like an mbed project"
367
362
return
368
363
369
364
for root , _ , obj_files in os .walk (search_path ):
@@ -580,12 +575,12 @@ def parse(self, mapfile, toolchain):
580
575
with open (mapfile , 'r' ) as file_input :
581
576
if toolchain == "ARM" or toolchain == "ARM_STD" or \
582
577
toolchain == "ARM_MICRO" :
583
- self .search_objects (os .path .abspath (mapfile ), "ARM" )
578
+ self .search_objects (os .path .abspath (mapfile ))
584
579
self .parse_map_file_armcc (file_input )
585
580
elif toolchain == "GCC_ARM" :
586
581
self .parse_map_file_gcc (file_input )
587
582
elif toolchain == "IAR" :
588
- self .search_objects (os .path .abspath (mapfile ), toolchain )
583
+ self .search_objects (os .path .abspath (mapfile ))
589
584
self .parse_map_file_iar (file_input )
590
585
else :
591
586
result = False
@@ -597,7 +592,7 @@ def parse(self, mapfile, toolchain):
597
592
def main ():
598
593
"""Entry Point"""
599
594
600
- version = '0.3.11 '
595
+ version = '0.3.12 '
601
596
602
597
# Parser handling
603
598
parser = argparse .ArgumentParser (
0 commit comments