mirror of https://github.com/stella-emu/stella.git
Extend debugger 'dump' command to take second parameter (for end of data range).
This commit is contained in:
parent
823c693a9e
commit
a018dc604a
|
@ -27,6 +27,9 @@
|
||||||
* Added debugger pseudo-register '_fcycles', which gives the number of
|
* Added debugger pseudo-register '_fcycles', which gives the number of
|
||||||
CPU cycles that have occurred since the frame started.
|
CPU cycles that have occurred since the frame started.
|
||||||
|
|
||||||
|
* Extended debugger 'dump' command to take a second argument, indicating
|
||||||
|
the end of the range to dump data.
|
||||||
|
|
||||||
* Improved emulation of 'FE' bankswitch scheme (no user-visible changes,
|
* Improved emulation of 'FE' bankswitch scheme (no user-visible changes,
|
||||||
but internally the emulation is much more accurate compared to the
|
but internally the emulation is much more accurate compared to the
|
||||||
real thing). Related to this, improved the debugger support for this
|
real thing). Related to this, improved the debugger support for this
|
||||||
|
|
|
@ -647,7 +647,7 @@ Type "help 'cmd'" to see extended information about the given command.</p>
|
||||||
delfunction - Delete function with label xx
|
delfunction - Delete function with label xx
|
||||||
delwatch - Delete watch <xx>
|
delwatch - Delete watch <xx>
|
||||||
disasm - Disassemble address xx [yy lines] (default=PC)
|
disasm - Disassemble address xx [yy lines] (default=PC)
|
||||||
dump - Dump 128 bytes of memory at address <xx>
|
dump - Dump data at address <xx> [to yy]
|
||||||
exec - Execute script file <xx>
|
exec - Execute script file <xx>
|
||||||
exitrom - Exit emulator, return to ROM launcher
|
exitrom - Exit emulator, return to ROM launcher
|
||||||
frame - Advance emulation by <xx> frames (default=1)
|
frame - Advance emulation by <xx> frames (default=1)
|
||||||
|
|
|
@ -891,16 +891,37 @@ void DebuggerParser::executeDisasm()
|
||||||
// "dump"
|
// "dump"
|
||||||
void DebuggerParser::executeDump()
|
void DebuggerParser::executeDump()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < 8; ++i)
|
auto dump = [&](int start, int end)
|
||||||
{
|
{
|
||||||
int start = args[0] + i*16;
|
for(int i = start; i <= end; i += 16)
|
||||||
commandResult << Base::toString(start) << ": ";
|
|
||||||
for(int j = 0; j < 16; ++j)
|
|
||||||
{
|
{
|
||||||
commandResult << Base::toString(debugger.peek(start+j)) << " ";
|
// Print label every 16 bytes
|
||||||
if(j == 7) commandResult << "- ";
|
commandResult << Base::toString(i) << ": ";
|
||||||
|
|
||||||
|
for(int j = i; j < i+16 && j <= end; ++j)
|
||||||
|
{
|
||||||
|
commandResult << Base::toString(debugger.peek(j)) << " ";
|
||||||
|
if(j == i+7 && j != end) commandResult << "- ";
|
||||||
}
|
}
|
||||||
if(i != 7) commandResult << endl;
|
commandResult << endl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Error checking
|
||||||
|
if(argCount > 1 && args[1] < args[0])
|
||||||
|
{
|
||||||
|
commandResult << red("Start address must be <= end address");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(argCount == 1)
|
||||||
|
dump(args[0], args[0] + 127);
|
||||||
|
else if(argCount == 2)
|
||||||
|
dump(args[0], args[1]);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
commandResult << "wrong number of arguments";
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1875,11 +1896,13 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
|
||||||
|
|
||||||
{
|
{
|
||||||
"dump",
|
"dump",
|
||||||
"Dump 128 bytes of memory at address <xx>",
|
"Dump data at address <xx> [to yy]",
|
||||||
"Example: dump f000",
|
"Examples:\n"
|
||||||
|
" dump f000 - dumps 128 bytes @ f000\n"
|
||||||
|
" dump f000 f0ff - dumps all bytes from f000 to f0ff",
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
{ kARG_WORD, kARG_END_ARGS },
|
{ kARG_WORD, kARG_MULTI_BYTE },
|
||||||
std::mem_fn(&DebuggerParser::executeDump)
|
std::mem_fn(&DebuggerParser::executeDump)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue