2.9 Command Line Support for Code Coverage in MDB

Code Coverage support has been added for command line tools using MDB. To generate a code coverage report in MDB:

  • Generate an ELF file by enabling the code coverage property. See 2.5 Enable/Disable Code Coverage.
  • Select report type (html, gcov, all) – see table below.
  • Provide html report path (Default: project location)– see table below.
  • Set replacehtmlreport to true if the report already exists– see table below.
  • An HTML Report will be generated if you invoke the below example using MDB.

Example

Device PIC16F886
set xccodecoverage.reporttype html
set xccodecoverage.htmlreportpath d:\report
set xccodecoverage.replacehtmlreport true
Hwtool SIM
Program "d:\testCoverage.elf"
Break main.c:41
Run
Wait 2000
Quit

Refer to the Microchip Debugger (MDB) User's Guide (DS-50002102) for more information on command options. The online help is located at onlinedocs.microchip.com/ where you can search for “Microchip Debugger.” A PDF of the MDB User's Guide can be found on the MPLAB X IDE web page www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide, under the Documentation tab.