debugger: Some commands should not repeat.

Entering a blank command causes the last command to repeat. This doesn't make sense for the following commands:
help, quit, regs, context, printenv, setenv, nvedit, amicint, viaint.
This commit is contained in:
joevt 2023-07-28 14:15:17 -07:00 committed by dingusdev
parent 17983e7fad
commit 006a90f681
1 changed files with 11 additions and 0 deletions

View File

@ -487,10 +487,13 @@ void enter_debugger() {
cout << cmd << endl;
}
if (cmd == "help") {
cmd = "";
show_help();
} else if (cmd == "quit") {
cmd = "";
break;
} else if (cmd == "profile") {
cmd = "";
ss >> sub_cmd;
ss >> profile_name;
@ -503,6 +506,7 @@ void enter_debugger() {
}
}
else if (cmd == "regs") {
cmd = "";
if (context == 2) {
#ifdef ENABLE_68K_DEBUGGER
print_68k_regs();
@ -585,6 +589,7 @@ void enter_debugger() {
cout << exc.what() << endl;
}
} else if (cmd == "go") {
cmd = "";
power_on = true;
ppc_exec(); // won't return!
} else if (cmd == "disas" || cmd == "da") {
@ -657,6 +662,7 @@ void enter_debugger() {
dump_mem(expr_str);
#ifdef ENABLE_68K_DEBUGGER
} else if (cmd == "context") {
cmd = "";
expr_str = "";
ss >> expr_str;
if (expr_str == "ppc" || expr_str == "PPC") {
@ -668,10 +674,12 @@ void enter_debugger() {
}
#endif
} else if (cmd == "printenv") {
cmd = "";
if (ofnvram->init())
continue;
ofnvram->printenv();
} else if (cmd == "setenv") {
cmd = "";
string var_name, value;
ss >> var_name;
std::istream::sentry se(ss); // skip white space
@ -681,6 +689,7 @@ void enter_debugger() {
ofnvram->setenv(var_name, value);
#ifndef _WIN32
} else if (cmd == "nvedit") {
cmd = "";
cout << "===== press CNTRL-C to save =====" << endl;
// save original terminal state
@ -730,6 +739,7 @@ void enter_debugger() {
#endif
#ifdef DEBUG_CPU_INT
} else if (cmd == "amicint") {
cmd = "";
string value;
int irq_id;
ss >> value;
@ -743,6 +753,7 @@ void enter_debugger() {
gMachineObj->get_comp_by_type(HWCompType::INT_CTRL));
int_ctrl->ack_int(irq_id, 1);
} else if (cmd == "viaint") {
cmd = "";
string value;
int irq_bit;
ss >> value;