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; buf >> hex >> start >> hex >> end;
addDirective(CartDebug::GFX, start, end, currentbank); 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")) else if(BSPF_startsWithIgnoreCase(directive, "DATA"))
{ {
buf >> hex >> start >> hex >> end; buf >> hex >> start >> hex >> end;

View File

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

View File

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