Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C Function Call tree Display

Status
Not open for further replies.

tom12sg

Member level 2
Member level 2
Joined
Feb 1, 2004
Messages
45
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Visit site
Activity points
422
call tree windows

Hi,

Is there any good program that shows a call tree display of the depth of C function call in any routine. Just wish to keep track and be aware of stack usage.
Thanks.
 

calltree c

I have not seen a program that can do this but some compilers are able to do this.

For example the Hi-Tech compilers for PIC and PIC18 you have to enable "generate map file" to get the so called call graph.

Looks like this:
Code:
Call graph:

*_main size 0,2 offset 0
     _i2c_wait size 0,1 offset 2
         _i2c_read size 0,3 offset 5
             _i2c_sendack
         _i2c_sendack
     _zufall_16 size 0,2 offset 4
     _EEPROM_lesen size 0,1 offset 2
     _sende_mist size 0,2 offset 2
         _zufall_16 size 0,2 offset 4
         _verschluesseln
         _i2c_write size 0,2 offset 4
     _verschluesseln
     _i2c_write size 0,2 offset 4
*    _ueberlese_mist size 0,3 offset 2
*        _i2c_read size 0,3 offset 5
*            _i2c_sendack
         _verschluesseln
*    _i2c_read size 0,3 offset 5
*        _i2c_sendack

Another approach is to fill the stack (this is not possible with PIC 12, 14 and 16 architecture) with a known pattern, for example 0xAA at power on and let the device work for lets say one hour.

Afterwards dump the stack for example via a serial connection to a PC and you will see how far your stack has been used :)

best regards
 

tree display in c

if you use the editor named "source insight", you can get all the relations windows you want (call, references et so more...)..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top