Skip to content

Commit 46c1b70

Browse files
committed
esp32: Proper handling of new GCOV command style
1 parent 57ccb08 commit 46c1b70

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/target/esp108_apptrace.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,13 @@ int esp_cmd_apptrace_generic(struct target *target, int mode, const char **argv,
20832083
}
20842084

20852085
if (strcmp(argv[0], "start") == 0) {
2086+
// TODO: remove this when gcov debug stubs support will be merged
2087+
res = esp108_apptrace_write_status(target, 0);
2088+
if (res != ERROR_OK) {
2089+
LOG_ERROR("Failed to write apptrace status (%d)!", res);
2090+
return res;
2091+
}
2092+
20862093
// init cmd context
20872094
res = esp_apptrace_cmd_init(target, &s_at_cmd_ctx, mode, &argv[1], argc-1);
20882095
if (res != ERROR_OK) {
@@ -2636,6 +2643,16 @@ int esp_cmd_gcov(struct target *target, const char **argv, int argc)
26362643
static struct esp_apptrace_cmd_ctx s_at_cmd_ctx;
26372644
int res = ERROR_OK;
26382645

2646+
if (argc == 0) {
2647+
LOG_ERROR("On-the-fly GCOV data dump is not supported in this version of OpenOCD!");
2648+
return ERROR_FAIL;
2649+
}
2650+
2651+
if (strcmp(argv[0], "dump") != 0) {
2652+
LOG_ERROR("Invalid action!");
2653+
return ERROR_FAIL;
2654+
}
2655+
26392656
// TODO: remove this when gcov debug stubs support will be merged
26402657
res = esp108_apptrace_write_status(target, 0);
26412658
if (res != ERROR_OK) {

0 commit comments

Comments
 (0)