cflow

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Has anybody here used the program 'cflow'?

http://www.gnu.org/software/cflow

cflow analyzes C source files and prints a graph, charting control flow within the program. Could be useful to create function call cross referecne, check for stack overflows... .

I downloaded and installed the 'cflow' under cygwin and made a new entry to WinAVR Makefile:

# cflow
cflow:
	cflow --cpp="avr-gcc -E" $(CDEFS) $(SRC)

I get rear error messages and finally a 'cflow' crash with 'stackdump'.

Did anybody here manage to successfully use 'cflow'.

Regards,
HJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you tested it without the preprocessor switch? (outside the Make file?) Maybe avr-gcc cannot be invoked as cpp with -E, or cflow chokes on the output.

# cflow srcfile.c

Just a thought. Not using Windows here, so no way to test.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't expect too much regarding the ablility to reveal run time problmes from a static analysis of the source code.

Olof

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your replies,

The problems seem to be rootcaused by the intensive usage of gcc-attributes in the WinAVR header files (whenever I have 'simple' C-Files without including "avr/xxx.h" cflow works as I expect it to do.
I will not do deeper investigations.

Whenever allocating some amount of variables in a RAM-limited AVR device it makes sense to think about the limitations. A static analysis with 'cflow' would be well suited to get a first impression easily.

Thanks,
HJ