Started Keys factoring

This commit is contained in:
Jeff Parsons 2016-09-15 07:59:12 -07:00
commit 5398064ec4
8 changed files with 571 additions and 524 deletions

View file

@ -47,7 +47,7 @@ if (DEBUGGER) {
*
* The Debugger component is a shared component containing a subset of functionality used by
* the other CPU-specific Debuggers (eg, DebuggerX86). Over time, the goal is to factor out as
* much common debugging support from those components into this one.
* much common debugging support as possible from those components into this one.
*/
function Debugger(parmsDbg)
{
@ -220,6 +220,39 @@ if (DEBUGGER) {
return true;
};
/**
* getPrevCommand()
*
* @this {Debugger}
* @return {string|null}
*/
Debugger.prototype.getPrevCommand = function()
{
var sCmd = null;
if (this.iPrevCmd < this.aPrevCmds.length - 1) {
sCmd = this.aPrevCmds[++this.iPrevCmd];
}
return sCmd;
};
/**
* getNextCommand()
*
* @this {Debugger}
* @return {string}
*/
Debugger.prototype.getNextCommand = function()
{
var sCmd;
if (this.iPrevCmd > 0) {
sCmd = this.aPrevCmds[--this.iPrevCmd];
} else {
sCmd = "";
this.iPrevCmd = -1;
}
return sCmd;
};
/**
* parseCommand(sCmd, fSave, chSep)
*