14
14
argparse_lowercase_hyphen_type , argparse_uppercase_type
15
15
16
16
DEBUG = False
17
- DETAILED = False
17
+
18
18
RE_ARMCC = re .compile (
19
19
r'^\s+0x(\w{8})\s+0x(\w{8})\s+(\w+)\s+(\w+)\s+(\d+)\s+[*]?.+\s+(.+)$' )
20
20
RE_IAR = re .compile (
@@ -25,7 +25,7 @@ class MemapParser(object):
25
25
"""An object that represents parsed results, parses the memory map files,
26
26
and writes out different file types of memory results
27
27
"""
28
-
28
+
29
29
print_sections = ('.text' , '.data' , '.bss' )
30
30
31
31
misc_flash_sections = ('.interrupts' , '.flash_config' )
@@ -41,7 +41,9 @@ class MemapParser(object):
41
41
def __init__ (self ):
42
42
""" General initialization
43
43
"""
44
-
44
+ #
45
+ self .detailed_misc = False
46
+
45
47
# list of all modules and their sections
46
48
self .modules = dict ()
47
49
@@ -91,8 +93,8 @@ def check_new_section_gcc(self, line):
91
93
else :
92
94
return False # everything else, means no change in section
93
95
94
- @ staticmethod
95
- def path_object_to_module_name (txt ):
96
+
97
+ def path_object_to_module_name (self , txt ):
96
98
""" Parse a path to object file to extract it's module and object data
97
99
98
100
Positional arguments:
@@ -116,7 +118,7 @@ def path_object_to_module_name(txt):
116
118
117
119
return [module_name , object_name ]
118
120
119
- elif DETAILED :
121
+ elif self . detailed_misc :
120
122
rex_obj_name = r'^.+\/(.+\.o\)*)$'
121
123
test_rex_obj_name = re .match (rex_obj_name , txt )
122
124
if test_rex_obj_name :
@@ -638,13 +640,14 @@ def main():
638
640
sys .exit (1 )
639
641
640
642
641
- args , remainder = parser .parse_known_args ()
642
-
643
- global DETAILED
644
- DETAILED = args .detailed
643
+ args = parser .parse_args ()
645
644
646
645
# Create memap object
647
646
memap = MemapParser ()
647
+
648
+ # Show Misc unfolded
649
+ if args .detailed :
650
+ memap .detailed_misc = True
648
651
649
652
# Parse and decode a map file
650
653
if args .file and args .toolchain :
0 commit comments