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

@ -509,6 +509,8 @@ string DebuggerParser::eval()
{ {
ostringstream buf; ostringstream buf;
for(uInt32 i = 0; i < argCount; ++i) for(uInt32 i = 0; i < argCount; ++i)
{
if(args[i] < 0x10000)
{ {
string rlabel = debugger.cartDebug().getLabel(args[i], true); string rlabel = debugger.cartDebug().getLabel(args[i], true);
string wlabel = debugger.cartDebug().getLabel(args[i], false); string wlabel = debugger.cartDebug().getLabel(args[i], false);
@ -525,13 +527,12 @@ string DebuggerParser::eval()
buf << rlabel << "(R): "; buf << rlabel << "(R): ";
else if(validW) else if(validW)
buf << wlabel << "(W): "; buf << wlabel << "(W): ";
}
if(args[i] < 0x100) buf << "$" << Base::toString(args[i], Base::F_16);
buf << "$" << Base::toString(args[i], Base::F_16_2)
<< " %" << Base::toString(args[i], Base::F_2_8); if(args[i] < 0x10000)
else buf << " %" << Base::toString(args[i], Base::F_2);
buf << "$" << Base::toString(args[i], Base::F_16_4)
<< " %" << Base::toString(args[i], Base::F_2_16);
buf << " #" << int(args[i]); buf << " #" << int(args[i]);
if(i != argCount - 1) 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" // "exec"
void DebuggerParser::executeExec() void DebuggerParser::executeExec()
@ -1937,16 +1924,6 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
std::mem_fn(&DebuggerParser::executeDump) 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", "exec",
"Execute script file <xx>", "Execute script file <xx>",
@ -2125,7 +2102,7 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
"Example: print pc, print f000", "Example: print pc, print f000",
true, true,
false, false,
{ kARG_WORD, kARG_END_ARGS }, { kARG_DWORD, kARG_END_ARGS },
std::mem_fn(&DebuggerParser::executePrint) std::mem_fn(&DebuggerParser::executePrint)
}, },

View File

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