Added support for a Debugger "base" option that presets the default base (eg, 8, 10, 16) for most numeric input/output
This commit is contained in:
parent
1df54a338f
commit
a15e222076
4 changed files with 23 additions and 13 deletions
|
|
@ -8,5 +8,5 @@
|
||||||
<rom id="rom" addr="0xC000" size="0x0570" file="/devices/pdp11/rom/custom/bootcode.json"/>
|
<rom id="rom" addr="0xC000" size="0x0570" file="/devices/pdp11/rom/custom/bootcode.json"/>
|
||||||
<ram id="ram" addr="0x10000" size="0x34000"/>
|
<ram id="ram" addr="0x10000" size="0x34000"/>
|
||||||
<panel ref="/devices/pdp11/panel/1170/wide.xml"/>
|
<panel ref="/devices/pdp11/panel/1170/wide.xml"/>
|
||||||
<debugger id="debugger"/>
|
<debugger id="debugger" base="8"/>
|
||||||
</machine>
|
</machine>
|
||||||
|
|
|
||||||
|
|
@ -69,10 +69,6 @@ var DbgAddrPDP11;
|
||||||
/**
|
/**
|
||||||
* DebuggerPDP11(parmsDbg)
|
* DebuggerPDP11(parmsDbg)
|
||||||
*
|
*
|
||||||
* @constructor
|
|
||||||
* @extends Debugger
|
|
||||||
* @param {Object} parmsDbg
|
|
||||||
*
|
|
||||||
* The DebuggerPDP11 component supports the following optional (parmsDbg) properties:
|
* The DebuggerPDP11 component supports the following optional (parmsDbg) properties:
|
||||||
*
|
*
|
||||||
* commands: string containing zero or more commands, separated by ';'
|
* commands: string containing zero or more commands, separated by ';'
|
||||||
|
|
@ -82,6 +78,10 @@ var DbgAddrPDP11;
|
||||||
*
|
*
|
||||||
* The DebuggerPDP11 component is an optional component that implements a variety of user
|
* The DebuggerPDP11 component is an optional component that implements a variety of user
|
||||||
* commands for controlling the CPU, dumping and editing memory, etc.
|
* commands for controlling the CPU, dumping and editing memory, etc.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @extends Debugger
|
||||||
|
* @param {Object} parmsDbg
|
||||||
*/
|
*/
|
||||||
function DebuggerPDP11(parmsDbg)
|
function DebuggerPDP11(parmsDbg)
|
||||||
{
|
{
|
||||||
|
|
@ -1921,15 +1921,15 @@ if (DEBUGGER) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var sOpcodes = "";
|
var sOpcodes = "";
|
||||||
var sLine = this.toStrAddr(dbgAddrOp) + ": ";
|
var sLine = this.toStrAddr(dbgAddrOp) + ":";
|
||||||
if (dbgAddrOp.addr !== PDP11.ADDR_INVALID && dbgAddr.addr !== PDP11.ADDR_INVALID) {
|
if (dbgAddrOp.addr !== PDP11.ADDR_INVALID && dbgAddr.addr !== PDP11.ADDR_INVALID) {
|
||||||
do {
|
do {
|
||||||
sOpcodes += this.toStrBase(this.getWord(dbgAddrOp, true));
|
sOpcodes += ' ' + this.toStrBase(this.getWord(dbgAddrOp, true));
|
||||||
if (dbgAddrOp.addr == null) break;
|
if (dbgAddrOp.addr == null) break;
|
||||||
} while (dbgAddrOp.addr != dbgAddr.addr);
|
} while (dbgAddrOp.addr != dbgAddr.addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
sLine += str.pad(sOpcodes, 10);
|
sLine += str.pad(sOpcodes, 15);
|
||||||
sLine += str.pad(sOpName, 7);
|
sLine += str.pad(sOpName, 7);
|
||||||
if (sOperands) sLine += ' ' + sOperands;
|
if (sOperands) sLine += ' ' + sOperands;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,13 +60,17 @@ var DbgAddr;
|
||||||
/**
|
/**
|
||||||
* Debugger(parmsDbg)
|
* Debugger(parmsDbg)
|
||||||
*
|
*
|
||||||
* @constructor
|
* The Debugger component supports the following optional (parmsDbg) properties:
|
||||||
* @extends Component
|
*
|
||||||
* @param {Object} parmsDbg
|
* base: the base to use for most numeric input/output (default is 16)
|
||||||
*
|
*
|
||||||
* The Debugger component is a shared component containing a subset of functionality used by
|
* 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
|
* the other CPU-specific Debuggers (eg, DebuggerX86). Over time, the goal is to factor out as
|
||||||
* much common debugging support as possible from those components into this one.
|
* much common debugging support as possible from those components into this one.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @extends Component
|
||||||
|
* @param {Object} parmsDbg
|
||||||
*/
|
*/
|
||||||
function Debugger(parmsDbg)
|
function Debugger(parmsDbg)
|
||||||
{
|
{
|
||||||
|
|
@ -77,7 +81,7 @@ function Debugger(parmsDbg)
|
||||||
/*
|
/*
|
||||||
* Default base used to display all values; modified with the "s base" command.
|
* Default base used to display all values; modified with the "s base" command.
|
||||||
*/
|
*/
|
||||||
this.nBase = 16;
|
this.nBase = parmsDbg['base'] || 16;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These keep track of instruction activity, but only when tracing or when Debugger checks
|
* These keep track of instruction activity, but only when tracing or when Debugger checks
|
||||||
|
|
|
||||||
|
|
@ -1168,6 +1168,12 @@
|
||||||
|
|
||||||
<xsl:template match="debugger[not(@ref)]">
|
<xsl:template match="debugger[not(@ref)]">
|
||||||
<xsl:param name="machine" select="''"/>
|
<xsl:param name="machine" select="''"/>
|
||||||
|
<xsl:variable name="base">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="@base"><xsl:value-of select="@base"/></xsl:when>
|
||||||
|
<xsl:otherwise>16</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
<xsl:variable name="commands">
|
<xsl:variable name="commands">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@commands"><xsl:value-of select="@commands"/></xsl:when>
|
<xsl:when test="@commands"><xsl:value-of select="@commands"/></xsl:when>
|
||||||
|
|
@ -1183,7 +1189,7 @@
|
||||||
<xsl:call-template name="component">
|
<xsl:call-template name="component">
|
||||||
<xsl:with-param name="machine" select="$machine"/>
|
<xsl:with-param name="machine" select="$machine"/>
|
||||||
<xsl:with-param name="class">debugger</xsl:with-param>
|
<xsl:with-param name="class">debugger</xsl:with-param>
|
||||||
<xsl:with-param name="parms">,commands:'<xsl:value-of select="$commands"/>',messages:'<xsl:value-of select="$messages"/>'</xsl:with-param>
|
<xsl:with-param name="parms">,base:<xsl:value-of select="$base"/>,commands:'<xsl:value-of select="$commands"/>',messages:'<xsl:value-of select="$messages"/>'</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue