From 9e583f146f1053660c9f5111edd5555a08f66d4c Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 3 Oct 2010 22:09:34 +0000 Subject: [PATCH] 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 --- src/debugger/DebuggerParser.cxx | 47 ++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index 3b3fd33ee..002f44594 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -1426,25 +1426,46 @@ void DebuggerParser::executeTrace() // "trap" void DebuggerParser::executeTrap() { - debugger->toggleReadTrap(args[0]); - debugger->toggleWriteTrap(args[0]); - commandResult << trapStatus(args[0]); + uInt32 beg = 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); + debugger->toggleWriteTrap(i); + commandResult << trapStatus(i) << endl; + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // "trapread" void DebuggerParser::executeTrapread() { - debugger->toggleReadTrap(args[0]); - commandResult << trapStatus(args[0]); + uInt32 beg = 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" void DebuggerParser::executeTrapwrite() { - debugger->toggleWriteTrap(args[0]); - commandResult << trapStatus(args[0]); + uInt32 beg = 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 read and write accesses to address xx", + "Trap read/write access to address(es) xx [to yy]", true, false, - { kARG_WORD, kARG_END_ARGS }, + { kARG_WORD, kARG_MULTI_BYTE }, &DebuggerParser::executeTrap }, { "trapread", - "Trap read accesses to address xx", + "Trap read access to address(es) xx [to yy]", true, false, - { kARG_WORD, kARG_END_ARGS }, + { kARG_WORD, kARG_MULTI_BYTE }, &DebuggerParser::executeTrapread }, { "trapwrite", - "Trap write accesses to address xx", + "Trap write access to address(es) xx [to yy]", true, false, - { kARG_WORD, kARG_END_ARGS }, + { kARG_WORD, kARG_MULTI_BYTE }, &DebuggerParser::executeTrapwrite },