The call graph shows the call hierarchy associated with functions in a program. In other words, which functions are called by a particular function. The MPLAB® XC8 compiler places the call graph in the list file.
The following is an example of a call graph for a simple program.
Code snippet:
The call hierarchy from the Compiler generated map file, under Project directory:
Call Graph Table:
---------------------------------------------------------------------------------
(Depth) Function Calls Base Space Used Autos Params Refs
---------------------------------------------------------------------------------
(0) _main 0 0 0 69
_printf
---------------------------------------------------------------------------------
(1) _printf 11 11 0 69
1 COMRAM 3 3 0
_putch
---------------------------------------------------------------------------------
(2) _putch 1 1 0 15
0 COMRAM 1 1 0
---------------------------------------------------------------------------------
Estimated maximum stack depth 2
---------------------------------------------------------------------------------
Call Graph Graphs:
_main (ROOT)
_printf
_putch
- Base: The start address of this block in the compiled stack
- Space: The memory space in which this block of the compiled stack will reside (data/program etc)
- Used: How many bytes were used in this space
- Autos: The number of autos and temporary variables defined in this function that uses memory in the compiled stack
- Params: The number of parameters defined in this function that uses memory in the compiled stack
- Refs: The total number of references to local objects in this function
main() is the root of a call graph (note that in assembly domain the main is referred to as _main)
Refer to the Compiler manual for more details about the Call Graph.