I was trying to do code coverage on a simple hello world program in C++.
The target device is an arm processor and hence I am using GNU ARM toolchain.
arm-elf-gcc -mcpu=arm7tdmi -O2 -g -c main.c -o main.exe creates a .gcno file but fails to create a .gcda file which is needed by gcov to find out the code coverage.
Normally when I run g++/gcc -fprofile-arcs -ftest-coverage .cpp,it first creates a .gcno file and an .exe. After running the a.exe , it generates the .gcda file.
Here when I try to run the main.exe to generate the .gcda, it throws an error – Program too big to fit in memory.
How do I resolve this issue?
Am I going wrong somehere?
Thanks,
A-J
Obviously, you have to run your executable on the target device. The target device must have a filesystem. Upon exit, the executable writes coverage information using ordinary POSIX functions –
open,fcntl,write,close, etc. Look atgcov-io.cin GCC sources. Make sure you can successfully linklibgcov.ainto your executable, that you have write permission on the target device, etc.