Disassembly
Disassembly is done per executable section, starting at the first address of each function and taking instruction by instruction until the next function or end of section. If function information is not available then disassembly will be done from the beginning of the section to the end of the section instead. The latter behavior can be forced by using the -whole-section
flag with the disassemble command. Data in the executable section may corrupt the disassembly, especially for variable length instruction platforms, as this data is also treated as instructions and disassembled. Disassembly will be performed on data from the original executable file, so any code that is modified in memory (compressed code as an example) will not be reflected in the report. Code that is not part of any executable section, will not be included in the report.
Sections
When disassembling an executable section, it is assumed that the executable section has the same architecture for the entire mapping, this is taken from the binary. Code that mixes different processor modes, 16, 32 and 64 bit for example, may therefore end up with incorrect disassembly.
PDB format
PDB symbol information is only supported on Microsoft* Windows*.
Quality
This code coverage implementation is purely based on available debug information and does not require modifications to the binary. This means that the executable source lines and executed source lines information depends highly on the quality of debug information. Usually this improves by decreasing optimization level. Due to inlining of functions and various optimizations the source coverage may be hard to interpret.
Architectures
For disassembly, only classes that implement the class_disassembly
interface plus x86 and ARM families are supported. Other architectures where the processor model supports instrumentation, source only coverage can be output.
When disassembling without the class_disassembly
interface, some instructions that were added in recent architectures might not be disassembled correctly in the disassembly report.
Reverse Execution
The code coverage implementation does not support reverse execution.
VMP
VMP will not be engaged while code coverage is collecting data.
Branch coverage
Currently only x86 and ARM families support branch coverage.
ARM branch coverage
For branch coverage on ARM only B<cond>
, CBZ
, CBNZ
, TBZ
and TBNZ
instructions are handled. Any other conditional instructions, including BL
, BX
and similar are not included in branch coverage. Neither are Thumb instructions made conditional by an IT-block handled by branch coverage.
x86 16-bit real mode
Instructions in 16-bit real mode will be disassembled as 32-bit instructions. This is because the ELF header or sections do not have any information about 16-bit mode. This can result in that both disassembly and source coverage for 16-bit real mode code gets incorrect.