Better reporting when monitor command fails.

This commit is contained in:
Uwe Bonnes 2021-09-22 19:59:51 +02:00 committed by UweBonnes
parent 9e98cfa220
commit 554e34517e
3 changed files with 6 additions and 3 deletions

View File

@ -374,7 +374,8 @@ handle_q_packet(char *packet, int len)
else if(c == 0)
gdb_putpacketz("OK");
else
gdb_putpacketz("E");
gdb_putpacket(hexify(pbuf, "Failed\n", strlen("Failed\n")),
2 * strlen("Failed\n"));
} else if (!strncmp (packet, "qSupported", 10)) {
/* Query supported protocol features */

View File

@ -448,7 +448,9 @@ int cl_execute(BMP_CL_OPTIONS_t *opt)
DEBUG_WARN("No test for this core type yet\n");
}
} else if (opt->opt_mode == BMP_MODE_MONITOR) {
command_process(t, opt->opt_monitor);
res = command_process(t, opt->opt_monitor);
if (res)
DEBUG_WARN("Command \"%s\" failed\n", opt->opt_monitor);
}
if ((opt->opt_mode == BMP_MODE_TEST) ||
(opt->opt_mode == BMP_MODE_SWJ_TEST))

View File

@ -574,7 +574,7 @@ int target_command(target *t, int argc, const char *argv[])
for (struct target_command_s *tc = t->commands; tc; tc = tc->next)
for(const struct command_s *c = tc->cmds; c->cmd; c++)
if(!strncmp(argv[0], c->cmd, strlen(argv[0])))
return !c->handler(t, argc, argv);
return (c->handler(t, argc, argv)) ? 0 : 1;
return -1;
}