Does gcov provide code coverage analysis for assembly language code

I have an application that I am building with gcc on a linux host for a target ARM processor. This generated executable that I am executing on an ARM development board I have. I want to do some code coverage analysis:

  • Will gcov show code coverage if I have ARM build source files in my build environment?
  • If there are some X86 build source files in my build environment, will gcov display code coverage data?

Thank. -AD.

+2


source to share


1 answer


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



If that happens, I would be surprised if he figured out how to safely inject code into arbitrary target assembly code, with ARM being common enough so there is little chance. The problem with the assembly control code is that the probe test code itself may require registers, and there is no reliable way to find out for an arbitrary part of the collectors, a) which registers are available, and b) if there is an inserted instruction, there will be some other instruction break from for extra space (for example, a wire-bound jump through an inserted statement).

+2


source







All Articles