gnupic: pic18f4455 - call graph


Previous by date: 9 Jun 2011 07:08:12 -0000 pic18f4455 - call graph, Sivaram Gowkanapalli
Next by date: 9 Jun 2011 07:08:12 -0000 Re: pic18f4455 - call graph, Vaclav Peroutka
Previous in thread: 9 Jun 2011 07:08:12 -0000 pic18f4455 - call graph, Sivaram Gowkanapalli
Next in thread: 9 Jun 2011 07:08:12 -0000 Re: pic18f4455 - call graph, Vaclav Peroutka

Subject: Re: pic18f4455 - call graph
From: Marko Kohtala ####@####.####
Date: 9 Jun 2011 07:08:12 -0000
Message-Id: <BANLkTinmfVXaFUZkHnAF4_pUu=GZVriZBQ@mail.gmail.com>

I do not remember seeing one. But I thought about it a while back.

MPLAB C compiler records call tree, but I don't remember if the
compiler does tail call optimization requiring some analysis to
determine if stack is really used or if there is just a goto to next
function. Assembly is more difficult because it does not enforce
functions and therefore it requires some more analysis to find nested
calls. From a call tree you could see the possibility for stack
overflow, but it may not be real because a function may not always
execute every call contained in it. Think about recursive calls. You
need to have room for interrupts and they may not always be enabled
and not always use the same amount of stack. And then are the programs
that use dynamic calls through function pointers so it is hard to know
which function is being called.

It would be a fun utility to write. If there are no dynamic calls, it
might work by analyzing the binary for basic blocks. For every block
that is a target of a call it would find all reachable blocks until a
return or loop with no return. It could build the tree from the calls
in those basic blocks. It could use as the start of the tree the reset
address and interrupt vectors.

Marko

On Wed, Jun 8, 2011 at 4:26 PM, Sivaram Gowkanapalli
####@####.#### wrote:
>
> Hello,
> I am wondering if there is any functionality in gputils to see the call graph/call tree?
> Given the limitation of the hardware stack being 31 levels deep, I want to ensurethat none of my call's are nested that deep.
> Any thoughts, please?
> ThanksSiva

Previous by date: 9 Jun 2011 07:08:12 -0000 pic18f4455 - call graph, Sivaram Gowkanapalli
Next by date: 9 Jun 2011 07:08:12 -0000 Re: pic18f4455 - call graph, Vaclav Peroutka
Previous in thread: 9 Jun 2011 07:08:12 -0000 pic18f4455 - call graph, Sivaram Gowkanapalli
Next in thread: 9 Jun 2011 07:08:12 -0000 Re: pic18f4455 - call graph, Vaclav Peroutka


Powered by ezmlm-browse 0.20.