Added debugger prompt commands for the remaining directive types.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2161 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-10-23 17:50:45 +00:00
parent 0af08634a8
commit dac213c6c3
3 changed files with 111 additions and 7 deletions

View File

@ -770,6 +770,11 @@ string CartDebug::loadConfigFile(string file)
buf >> hex >> start >> hex >> end;
addDirective(CartDebug::GFX, start, end, currentbank);
}
else if(BSPF_startsWithIgnoreCase(directive, "PGFX"))
{
buf >> hex >> start >> hex >> end;
addDirective(CartDebug::PGFX, start, end, currentbank);
}
else if(BSPF_startsWithIgnoreCase(directive, "DATA"))
{
buf >> hex >> start >> hex >> end;

View File

@ -820,8 +820,8 @@ void DebuggerParser::executeCode()
bool result = debugger->cartDebug().addDirective(
CartDebug::CODE, args[0], args[1]);
commandResult << (result ? "added" : "removed") << " CODE directive on range $" << hex << args[0]
<< " $" << hex << args[1];
commandResult << (result ? "added" : "removed") << " CODE directive on range $"
<< hex << args[0] << " $" << hex << args[1];
debugger->myRom->invalidate();
}
@ -861,8 +861,8 @@ void DebuggerParser::executeData()
bool result = debugger->cartDebug().addDirective(
CartDebug::DATA, args[0], args[1]);
commandResult << (result ? "added" : "removed") << " DATA directive on range $" << hex << args[0]
<< " $" << hex << args[1];
commandResult << (result ? "added" : "removed") << " DATA directive on range $"
<< hex << args[0] << " $" << hex << args[1];
debugger->myRom->invalidate();
}
@ -1000,8 +1000,8 @@ void DebuggerParser::executeGfx()
bool result = debugger->cartDebug().addDirective(
CartDebug::GFX, args[0], args[1]);
commandResult << (result ? "added" : "removed") << " GFX directive on range $" << hex << args[0]
<< " $" << hex << args[1];
commandResult << (result ? "added" : "removed") << " GFX directive on range $"
<< hex << args[0] << " $" << hex << args[1];
debugger->myRom->invalidate();
}
@ -1179,6 +1179,28 @@ void DebuggerParser::executePc()
debugger->cpuDebug().setPC(args[0]);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "pgfx"
void DebuggerParser::executePGfx()
{
if(argCount != 2)
{
commandResult << red("Specify start and end of range only");
return;
}
else if(args[1] < args[0])
{
commandResult << red("Start address must be <= end address");
return;
}
bool result = debugger->cartDebug().addDirective(
CartDebug::PGFX, args[0], args[1]);
commandResult << (result ? "added" : "removed") << " PGFX directive on range $"
<< hex << args[0] << " $" << hex << args[1];
debugger->myRom->invalidate();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "print"
void DebuggerParser::executePrint()
@ -1250,6 +1272,28 @@ void DebuggerParser::executeRom()
<< " location(s)";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "row"
void DebuggerParser::executeRow()
{
if(argCount != 2)
{
commandResult << red("Specify start and end of range only");
return;
}
else if(args[1] < args[0])
{
commandResult << red("Start address must be <= end address");
return;
}
bool result = debugger->cartDebug().addDirective(
CartDebug::ROW, args[0], args[1]);
commandResult << (result ? "added" : "removed") << " ROW directive on range $"
<< hex << args[0] << " $" << hex << args[1];
debugger->myRom->invalidate();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "run"
void DebuggerParser::executeRun()
@ -1403,6 +1447,31 @@ void DebuggerParser::executeScanline()
if(count != 1) commandResult << "s";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "skip"
void DebuggerParser::executeSkip()
{
commandResult << red("Not yet implemented");
/*
if(argCount != 2)
{
commandResult << red("Specify start and end of range only");
return;
}
else if(args[1] < args[0])
{
commandResult << red("Start address must be <= end address");
return;
}
bool result = debugger->cartDebug().addDirective(
CartDebug::SKIP, args[0], args[1]);
commandResult << (result ? "added" : "removed") << " SKIP directive on range $"
<< hex << args[0] << " $" << hex << args[1];
debugger->myRom->invalidate();
*/
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "step"
void DebuggerParser::executeStep()
@ -1891,6 +1960,15 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
&DebuggerParser::executePc
},
{
"pgfx",
"Mark 'PGFX' range in disassembly",
true,
false,
{ kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executePGfx
},
{
"print",
"Evaluate/print expression xx in hex/dec/binary",
@ -1945,6 +2023,15 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
&DebuggerParser::executeRom
},
{
"row",
"Mark 'ROW' range in disassembly",
true,
false,
{ kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executeRow
},
{
"run",
"Exit debugger, return to emulator",
@ -2035,6 +2122,15 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
&DebuggerParser::executeScanline
},
{
"skip",
"Mark 'SKIP' range in disassembly",
true,
false,
{ kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executeSkip
},
{
"step",
"Single step CPU [with count xx]",

View File

@ -83,7 +83,7 @@ class DebuggerParser
private:
enum {
kNumCommands = 66,
kNumCommands = 69,
kMAX_ARG_TYPES = 10
};
@ -171,12 +171,14 @@ class DebuggerParser
void executeLoadsym();
void executeN();
void executePc();
void executePGfx();
void executePrint();
void executeRam();
void executeReset();
void executeRewind();
void executeRiot();
void executeRom();
void executeRow();
void executeRun();
void executeRunTo();
void executeRunToPc();
@ -187,6 +189,7 @@ class DebuggerParser
void executeSaveses();
void executeSavestate();
void executeScanline();
void executeSkip();
void executeStep();
void executeTia();
void executeTrace();