removed 'echo' and enhanced 'print' instead

This commit is contained in:
thrust26 2017-10-02 22:12:10 +02:00
parent 3ca6f5a9d3
commit e10ca8e694
2 changed files with 22 additions and 46 deletions

View File

@ -510,28 +510,29 @@ string DebuggerParser::eval()
ostringstream buf;
for(uInt32 i = 0; i < argCount; ++i)
{
string rlabel = debugger.cartDebug().getLabel(args[i], true);
string wlabel = debugger.cartDebug().getLabel(args[i], false);
bool validR = rlabel != "" && rlabel[0] != '$',
validW = wlabel != "" && wlabel[0] != '$';
if(validR && validW)
if(args[i] < 0x10000)
{
if(rlabel == wlabel)
buf << rlabel << "(R/W): ";
else
buf << rlabel << "(R) / " << wlabel << "(W): ";
string rlabel = debugger.cartDebug().getLabel(args[i], true);
string wlabel = debugger.cartDebug().getLabel(args[i], false);
bool validR = rlabel != "" && rlabel[0] != '$',
validW = wlabel != "" && wlabel[0] != '$';
if(validR && validW)
{
if(rlabel == wlabel)
buf << rlabel << "(R/W): ";
else
buf << rlabel << "(R) / " << wlabel << "(W): ";
}
else if(validR)
buf << rlabel << "(R): ";
else if(validW)
buf << wlabel << "(W): ";
}
else if(validR)
buf << rlabel << "(R): ";
else if(validW)
buf << wlabel << "(W): ";
if(args[i] < 0x100)
buf << "$" << Base::toString(args[i], Base::F_16_2)
<< " %" << Base::toString(args[i], Base::F_2_8);
else
buf << "$" << Base::toString(args[i], Base::F_16_4)
<< " %" << Base::toString(args[i], Base::F_2_16);
buf << "$" << Base::toString(args[i], Base::F_16);
if(args[i] < 0x10000)
buf << " %" << Base::toString(args[i], Base::F_2);
buf << " #" << int(args[i]);
if(i != argCount - 1)
@ -933,20 +934,6 @@ void DebuggerParser::executeDump()
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "echo"
void DebuggerParser::executeEcho()
{
int res = YaccParser::parse(argStrings[0].c_str());
if(res == 0)
{
unique_ptr<Expression> expr(YaccParser::getResult());
commandResult << expr->evaluate();
}
else
commandResult << red("invalid expression");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "exec"
void DebuggerParser::executeExec()
@ -1937,16 +1924,6 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
std::mem_fn(&DebuggerParser::executeDump)
},
{
"echo",
"Echo expression result",
"Example: echo _fycles, echo _scan*#76, echo _bank==1",
false,
true,
{ kARG_DWORD, kARG_END_ARGS },
std::mem_fn(&DebuggerParser::executeEcho)
},
{
"exec",
"Execute script file <xx>",
@ -2125,7 +2102,7 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
"Example: print pc, print f000",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
{ kARG_DWORD, kARG_END_ARGS },
std::mem_fn(&DebuggerParser::executePrint)
},

View File

@ -68,7 +68,7 @@ class DebuggerParser
bool saveScriptFile(string file);
private:
enum { kNumCommands = 73 };
enum { kNumCommands = 72 };
// Constants for argument processing
enum {
@ -144,7 +144,6 @@ class DebuggerParser
void executeDelwatch();
void executeDisasm();
void executeDump();
void executeEcho();
void executeExec();
void executeExitRom();
void executeFrame();