How do I interpret the call graph in the XC8 list file?

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.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.