From 656a6a2c8dac19167bd55177d95ea46679fbb10b Mon Sep 17 00:00:00 2001 From: Chintalagiri Shashank Date: Sun, 24 Mar 2019 14:26:48 +0530 Subject: [PATCH] Quick, untested fix for ARM mapfile which seem to generate children before parents in some instances. There are likely unhandled or incorrectly quirks this way. --- docs/installation.rst | 6 +++--- fpvgcc/cli.py | 6 ++---- fpvgcc/fpv.py | 15 +++++++++++++-- fpvgcc/gccMemoryMap.py | 2 +- setup.py | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 088f159..0ad7902 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -39,10 +39,10 @@ in your python environment by whatever means you usually use. .. code-block:: console - $ wget https://github.com/chintal/fpv-gcc/archive/v0.6.zip - $ unzip fpv-gcc-0.6.zip + $ wget https://github.com/chintal/fpv-gcc/archive/v0.8.2.zip + $ unzip fpv-gcc-0.8.2.zip ... - $ cd fpv-gcc-0.6 + $ cd fpv-gcc-0.8.2 $ sudo python setup.py install ... $ fpvgcc diff --git a/fpvgcc/cli.py b/fpvgcc/cli.py index b1a676c..3280e1b 100644 --- a/fpvgcc/cli.py +++ b/fpvgcc/cli.py @@ -205,12 +205,10 @@ def main(): parser = _get_parser() args = parser.parse_args() if args.verbose == 0: - logging.basicConfig(level=logging.ERROR) - elif args.verbose == 1: logging.basicConfig(level=logging.WARNING) - elif args.verbose == 2: + elif args.verbose == 1: logging.basicConfig(level=logging.INFO) - elif args.verbose == 3: + elif args.verbose == 2: logging.basicConfig(level=logging.DEBUG) state_machine = process_map_file(args.mapfile) if args.sar: diff --git a/fpvgcc/fpv.py b/fpvgcc/fpv.py index 21dc128..a35454c 100644 --- a/fpvgcc/fpv.py +++ b/fpvgcc/fpv.py @@ -1,4 +1,3 @@ - # Copyright (c) # (c) 2015-16 Chintalagiri Shashank, Quazar Technologies Pvt. Ltd. # @@ -52,6 +51,18 @@ def __init__(self): self.linker_defined_addresses = [] self.memory_map = GCCMemoryMap() + def __repr__(self): + return "".format(self.linkermap_lastsymbol) + # Regular Expressions re_headings = { @@ -499,7 +510,7 @@ def process_linkermap_line(l, sm): if re_linkermap['SYMBOLONLY'].match(l): process_linkermap_symbolonly_line(l, sm) return - # logging.error("Unhandled line in section : {0}".format(l.strip())) + logging.error("Unhandled line in section : {0}".format(l.strip())) return None diff --git a/fpvgcc/gccMemoryMap.py b/fpvgcc/gccMemoryMap.py index b919745..7f9d840 100644 --- a/fpvgcc/gccMemoryMap.py +++ b/fpvgcc/gccMemoryMap.py @@ -156,7 +156,7 @@ def push_to_leaf(self): if not self.objfile: logging.warning("No objfile defined. Can't push to leaf : " "{0}".format(self.gident)) - return + return self for child in self.children: if child.name == self.objfile.replace('.', '_'): return diff --git a/setup.py b/setup.py index 12716b0..eaf0ff0 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ def read(fname): setup( name="fpvgcc", - version="0.8.1", + version="0.8.2", author="Chintalagiri Shashank", author_email="shashank@chintal.in", description="Analysing code footprint on embedded microcontrollers "