command: Cleaned up cmd_debug_bmp

This commit is contained in:
dragonmux 2022-07-26 16:41:31 +01:00 committed by Piotr Esden-Tempski
parent a467568325
commit e013b48139
1 changed files with 9 additions and 12 deletions

View File

@ -615,23 +615,20 @@ static bool cmd_traceswo(target *t, int argc, const char **argv)
static bool cmd_debug_bmp(target *t, int argc, const char **argv)
{
(void)t;
bool print_status = false;
if (argc == 1) {
print_status = true;
} else if (argc == 2) {
if (parse_enable_or_disable(argv[1], &debug_bmp)) {
print_status = true;
}
} else {
gdb_outf("Unrecognized command format\n");
if (argc == 2) {
if (!parse_enable_or_disable(argv[1], &debug_bmp))
return false;
}
else if (argc > 2) {
gdb_outf("usage: monitor debug [enable|disable]\n");
return false;
}
if (print_status) {
gdb_outf("Debug mode is %s\n", debug_bmp ? "enabled" : "disabled");
}
gdb_outf("Debug mode is %s\n", debug_bmp ? "enabled" : "disabled");
return true;
}
#endif
static bool cmd_heapinfo(target *t, int argc, const char **argv)
{
if (t == NULL)