The various trap commands in the debugger (trap, trapread, trapwrite) now

accept a second argument, indicating a range is to be used.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2141 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-10-03 22:09:34 +00:00
parent 64ca5275d2
commit 9e583f146f
1 changed files with 34 additions and 13 deletions

View File

@ -1426,25 +1426,46 @@ void DebuggerParser::executeTrace()
// "trap" // "trap"
void DebuggerParser::executeTrap() void DebuggerParser::executeTrap()
{ {
debugger->toggleReadTrap(args[0]); uInt32 beg = args[0];
debugger->toggleWriteTrap(args[0]); uInt32 end = argCount >= 2 ? args[1] : beg;
commandResult << trapStatus(args[0]); if(beg > end) BSPF_swap(beg, end);
for(uInt32 i = beg; i <= end; ++i)
{
debugger->toggleReadTrap(i);
debugger->toggleWriteTrap(i);
commandResult << trapStatus(i) << endl;
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "trapread" // "trapread"
void DebuggerParser::executeTrapread() void DebuggerParser::executeTrapread()
{ {
debugger->toggleReadTrap(args[0]); uInt32 beg = args[0];
commandResult << trapStatus(args[0]); uInt32 end = argCount >= 2 ? args[1] : beg;
if(beg > end) BSPF_swap(beg, end);
for(uInt32 i = beg; i <= end; ++i)
{
debugger->toggleReadTrap(i);
commandResult << trapStatus(i) << endl;
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "trapwrite" // "trapwrite"
void DebuggerParser::executeTrapwrite() void DebuggerParser::executeTrapwrite()
{ {
debugger->toggleWriteTrap(args[0]); uInt32 beg = args[0];
commandResult << trapStatus(args[0]); uInt32 end = argCount >= 2 ? args[1] : beg;
if(beg > end) BSPF_swap(beg, end);
for(uInt32 i = beg; i <= end; ++i)
{
debugger->toggleWriteTrap(i);
commandResult << trapStatus(i) << endl;
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -2012,28 +2033,28 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
{ {
"trap", "trap",
"Trap read and write accesses to address xx", "Trap read/write access to address(es) xx [to yy]",
true, true,
false, false,
{ kARG_WORD, kARG_END_ARGS }, { kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executeTrap &DebuggerParser::executeTrap
}, },
{ {
"trapread", "trapread",
"Trap read accesses to address xx", "Trap read access to address(es) xx [to yy]",
true, true,
false, false,
{ kARG_WORD, kARG_END_ARGS }, { kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executeTrapread &DebuggerParser::executeTrapread
}, },
{ {
"trapwrite", "trapwrite",
"Trap write accesses to address xx", "Trap write access to address(es) xx [to yy]",
true, true,
false, false,
{ kARG_WORD, kARG_END_ARGS }, { kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executeTrapwrite &DebuggerParser::executeTrapwrite
}, },