Skip to content

Commit

Permalink
docs: Updated documentation file and added images
Browse files Browse the repository at this point in the history
  • Loading branch information
alirana01 committed Sep 19, 2023
1 parent e9289a8 commit 1076037
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ To get a quick understanding about ESP-IDF and Eclipse plugin features check our
* [ Device Firmware Upgrade (DFU) through USB ](#deviceFirmwareUpgrade)<br>
* [ GDBStub Debugging ](#gdbStubDebugging)<br>
* [ Core Dump Debugging ](#coreDumpDebugging)<br>
* [ GCOV Code Coverage and Dump Generation ](#gcovCodeCoverage)<br>
* [ Application Level Tracing ](#appLvlTracing)<br>
* [ ESP-IDF master update](#updateEspIdfMaster)<br>
* [ Partition Table Editor UI for ESP-IDF](#partitionTableEditor)<br>
Expand Down Expand Up @@ -581,6 +582,38 @@ This will enable the core dump debugging and whenever you connect a serial monit

You can view the registers stack trace and even view the value of variables in stack frame. To exit the debug session simply press stop button.

<a name="gcovCodeCoverage"></a>

# GCOV Code Coverage and Dump Generation

The idf eclipse plugin allows you to generate and view the gcov code coverage reports.

For the purpose of the this documentation please use the example project [gcov](https://github.com/espressif/esp-idf/blob/master/examples/system/gcov/).
You can read about the project more in the project [README.MD](https://github.com/espressif/esp-idf/blob/master/examples/system/gcov/README.md) to learn more about the flags required to enable this.

After building and flashing the project you can start a normal debug session using the OpenOCD Launch Configuration. Once the debug session starts and the eclipse switches to the debug prespective you will notice two buttons on the IDF Process Console.
![](docs/images/GcovCodeCoverage/gcov-1.png)

The first button is to generate the instant runtime dump and the second button is to generate the hard coded dump. Based on where your program is you can create a dump. As per the example project the program halts twice for you to generate the hard-coded dump which you can do by pressing the second button.
The instant runtime dump can be generated by pressing the first button after the hard-coded dump is complete.

After your dumps are generated you can right click on the project and select the following option.
`ESP-IDF: View GCOV Files`

![](docs/images/GcovCodeCoverage/gcov-2.png)

This will open a view for you that will show you the dumps that are available for the eclipse to be analyzed.
![](docs/images/GcovCodeCoverage/gcov-3.png)

You can press the refresh button to update the view to show the latest files and use the select project button to select a different project.
Only one name is shown for both gcno and gcda files and only files that have a matching partner file with gcno or gcda are shown here.

You can double click on any shown file and you will receive the following dialog. ![](docs/images/GcovCodeCoverage/gcov-4.png).
You can either select to view the coverage for the selected file only or view the whole coverage
Depending upon what you selected you will either be shown the file and also a view that will contain the whole summary for the coverage.
![Summary View](docs/images/GcovCodeCoverage/gcov-5.png)
![File View](docs/images/GcovCodeCoverage/gcov-6.png)

<a name="deviceFirmwareUpgrade"></a>

# Device Firmware Upgrade (DFU) through USB
Expand Down
Binary file added docs/images/GcovCodeCoverage/gcov-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/GcovCodeCoverage/gcov-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/GcovCodeCoverage/gcov-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/GcovCodeCoverage/gcov-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/GcovCodeCoverage/gcov-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/GcovCodeCoverage/gcov-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1076037

Please sign in to comment.