mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 12:10:59 +00:00
esp32: Adds GCOV debug stubs support
Adds the following functionality - Debug stubs infrastructure - Stub for retrieveing GCOV data without user source code modification
This commit is contained in:
@@ -20,9 +20,11 @@
|
||||
|
||||
void blink_dummy_func(void);
|
||||
|
||||
void blink_task(void *pvParameter)
|
||||
static void blink_task(void *pvParameter)
|
||||
{
|
||||
int dump_gcov_after = 2;
|
||||
// The first two iterations GCOV data are dumped using call to esp_gcov_dump() and OOCD's "esp32 gcov dump" command.
|
||||
// After that they can be dumped using OOCD's "esp32 gcov" command only.
|
||||
int dump_gcov_after = -2;
|
||||
/* Configure the IOMUX register for pad BLINK_GPIO (some pads are
|
||||
muxed to GPIO on reset already, but some default to other
|
||||
functions and need to be switched to GPIO. Consult the
|
||||
@@ -32,21 +34,22 @@ void blink_task(void *pvParameter)
|
||||
gpio_pad_select_gpio(BLINK_GPIO);
|
||||
/* Set the GPIO as a push/pull output */
|
||||
gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
|
||||
while(dump_gcov_after-- > 0) {
|
||||
|
||||
while(1) {
|
||||
/* Blink off (output low) */
|
||||
gpio_set_level(BLINK_GPIO, 0);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
/* Blink on (output high) */
|
||||
gpio_set_level(BLINK_GPIO, 1);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
blink_dummy_func();
|
||||
if (dump_gcov_after++ < 0) {
|
||||
// Dump gcov data
|
||||
printf("Ready to dump GCOV data...\n");
|
||||
esp_gcov_dump();
|
||||
printf("GCOV data have been dumped.\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Dump gcov data
|
||||
printf("Ready to dump GCOV data...\n");
|
||||
esp_gcov_dump();
|
||||
printf("GCOV data have been dumped.\n");
|
||||
while(1);
|
||||
}
|
||||
|
||||
void app_main()
|
||||
|
Reference in New Issue
Block a user