views:

213

answers:

1

Hello,

I have an application which i build using gcc on linux host for ARM target processor. This generated arm executable i execute on a ARM development board i have. I want to do some code coverage analysis:

1.)Will gcov show code coverage if i have ARM assembly source files in my build environment?

2.) If my build environment has some X86 assembly source files, then will gcov show code coverage data?

Thank you. -AD.

A: 

AFAIK, gcov works by preprocessing your C or C++ source code. If you have pure assembly language files, I don't think gcov ever sees them.

If it does, I'd be suprised if it understand how to safely insert code in arbitrary-target assembly code, with ARM being common enough so there's a faint chance. The problem with instrumentating assembly code is the test coverage probe code itself may require registers, and there isn't a safe way to know, for an arbitrary piece of assemblers, a) what registers are available, and b) if there's an inserted instruction, will some other instruction break because of the extra space (e.g., a hardwired jump relative across the inserted instruction).

Ira Baxter