Skip to content

Commit

Permalink
Quick, untested fix for ARM mapfile which seem to generate children b…
Browse files Browse the repository at this point in the history
…efore parents in some instances. There are likely unhandled or incorrectly quirks this way.
  • Loading branch information
chintal committed Mar 24, 2019
1 parent 077b0c2 commit 656a6a2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/installation.rst
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions fpvgcc/cli.py
Expand Up @@ -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:
Expand Down
15 changes: 13 additions & 2 deletions fpvgcc/fpv.py
@@ -1,4 +1,3 @@

# Copyright (c)
# (c) 2015-16 Chintalagiri Shashank, Quazar Technologies Pvt. Ltd.
#
Expand Down Expand Up @@ -52,6 +51,18 @@ def __init__(self):
self.linker_defined_addresses = []
self.memory_map = GCCMemoryMap()

def __repr__(self):
return "<GCCMemoryMapParserSM \n" + \
" STATE = {0}\n".format(self.state) + \
" IDEP_STATE = {0}\n".format(self.IDEP_STATE) + \
" idep_archive = {0}\n".format(self.idep_archive) + \
" COMSYM_STATE = {0}\n".format(self.COMSYM_STATE) + \
" comsym_name = {0}\n".format(self.comsym_name) + \
" LINKERMAP_STATE = {0}\n".format(self.LINKERMAP_STATE) + \
" linkermap_section = {0}\n".format(self.linkermap_section) + \
" linkermap_symbol = {0}\n".format(self.linkermap_symbol) + \
" linkermap_lastsymbol = {0}\n>".format(self.linkermap_lastsymbol)


# Regular Expressions
re_headings = {
Expand Down Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion fpvgcc/gccMemoryMap.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -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 "
Expand Down

0 comments on commit 656a6a2

Please sign in to comment.