Some minor Debugger tweaks and other improvements

If a Markdown document contains an embedded machine that specifies a version number (eg, "1.15.6"), then the web server will switch to serving a compiled version, since that's the only way it can guarantee the requested version
This commit is contained in:
Jeff Parsons 2014-10-31 17:44:34 -07:00 • committed by jeffpar
commit 905a30017e
9 changed files with 911 additions and 889 deletions

View file

@ -1747,12 +1747,20 @@ HTMLOut.prototype.processMachines = function(aMachines, done)
HTMLOut.logDebug('HTMLOut.processMachines(' + JSON.stringify(infoMachine) + ')');
var sClass = infoMachine['class']; // aka the machine class
var sVersion = infoMachine['version'];
if (sVersion === undefined) sVersion = "*"; // default to newest version
var fDebugger = infoMachine['debugger'];
if (fDebugger === undefined) fDebugger = false; // default to no debugger
var fCompiled = infoMachine['compiled'];
if (fCompiled === undefined) fCompiled = !this.fDebug;
if (sVersion == "*") {
sVersion = pkg.version;
} else {
fCompiled = true; // use of a specific version requires using the compiled version
}
var fNoDebug = !fCompiled && net.hasParm(net.GORT_COMMAND, net.GORT_NODEBUG, this.req);
var sScriptEmbed = "";
@ -1764,8 +1772,8 @@ HTMLOut.prototype.processMachines = function(aMachines, done)
if (fCompiled) {
var sScriptFolder = sClass + "js"; // aka the app class
var sScriptFile = sClass + (fDebugger? "-dbg" : "") + ".js";
asFiles.push("/versions/" + sScriptFolder + "/" + pkg.version + "/components.css");
asFiles.push("/versions/" + sScriptFolder + "/" + pkg.version + "/" + sScriptFile);
asFiles.push("/versions/" + sScriptFolder + "/" + sVersion + "/components.css");
asFiles.push("/versions/" + sScriptFolder + "/" + sVersion + "/" + sScriptFile);
this.addFilesToHTML(asFiles, sScriptEmbed);
}
else {

View file

@ -1124,7 +1124,7 @@ Computer.prototype.onReset = function()
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
*/
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ !web.confirmUser("Click OK to save the " + Computer.sAppName + " machine state.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ web.confirmUser("Click OK to save changes to this " + Computer.sAppName + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
this.powerOff(fSave, true);
/*
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()

View file

@ -202,7 +202,7 @@ if (DEBUGGER) {
'?': "help",
'a [#]': "assemble",
'b [#]': "breakpoint",
'c': "clear window",
'c': "clear output",
'd [#]': "dump memory",
'e [#]': "edit memory",
'f': "frequencies",
@ -216,7 +216,9 @@ if (DEBUGGER) {
'r': "dump/edit registers",
't [#]': "step instruction(s)",
'u [#]': "unassemble",
'x': "execution options"
'x': "execution options",
'reset': "reset computer",
'ver': "display version"
};
/*
@ -4188,7 +4190,7 @@ if (DEBUGGER) {
fUnknown = false;
switch(sReg){
case "MS":
X86Help.opHelpLMSW(w);
X86Help.opHelpLMSW.call(this.cpu, w);
break;
case "TR":
this.cpu.segTSS.load(w);
@ -4530,6 +4532,9 @@ if (DEBUGGER) {
case "reset":
if (this.cmp) this.cmp.reset();
return true;
case "ver":
this.println((APPNAME || "PCjs") + " version " + APPVERSION + " (" + (COMPILED? "release" : (DEBUG? "debug" : "nodebug")) + (PREFETCH? ",prefetch" : "") + (TYPEDARRAYS? ",typedarrays" : (FATARRAYS? ",fatarrays" : "")) + ")");
return true;
default:
ch0 = sCmd.charAt(0);
for (i = 1; i < sCmd.length; i++) {

View file

@ -414,7 +414,13 @@ Disk.prototype.powerDown = function(fSave, fShutdown)
if (fShutdown) {
this.disconnectRemoteDisk();
}
if (!nErrorCode) this.controller.notice(this.sDiskName + " saved");
/*
* I only report that changes to the disk have been "saved" if fSave is true, to avoid confusing
* users who might not understand the difference between discarding local changes (which should restore
* all diskettes to their original state) and discarding remote changes (which could leave the remote disk
* in a bad state).
*/
if (!nErrorCode && fSave) this.controller.notice(this.sDiskName + " saved");
}
return true;
};

View file

@ -40,12 +40,12 @@ var APPNAME = ""; // this @define is overridden by the Closure Com
/**
* @define {string}
*/
var APPVERSION = "1.0.0"; // this @define is overridden by the Closure Compiler with the version in package.json
var APPVERSION = "1.x.x"; // this @define is overridden by the Closure Compiler with the version in package.json
/**
* @define {string}
*/
var SITEHOST = "pcjs:8088"; // this @define is overridden by the Closure Compiler with "www.pcjs.org"
var SITEHOST = "localhost:8088";// this @define is overridden by the Closure Compiler with "www.pcjs.org"
/**
* @define {boolean}

View file

@ -301,7 +301,7 @@ function embedMachine(sName, sVersion, idElement, sXMLFile, sXSLFile, sStateFile
/*
* Our MarkOut module (in convertMDMachineLinks()) creates machine containers that look like:
*
* <div id="' + sMachineID + '" class="machine-placeholder"><p>Embedded PC</p><p class="machine-warning"></p></div>
* <div id="' + sMachineID + '" class="machine-placeholder"><p>Embedded PC</p><p class="machine-warning">...</p></div>
*
* with the "machine-warning" paragraph pre-populated with a warning message that the user will
* see if nothing at all happens. But hopefully, in the normal case (and especially the error case),
@ -321,7 +321,7 @@ function embedMachine(sName, sVersion, idElement, sXMLFile, sXSLFile, sStateFile
if (eMachine) {
var sAppClass = sName.toLowerCase(); // eg, "pcjs" or "c1pjs"
if (!sXSLFile) {
if (DEBUG && sVersion == "1.0.0") {
if (DEBUG && sVersion == "1.x.x") {
sXSLFile = "/my_modules/" + sAppClass + "-client/templates/components.xsl";
} else {
sXSLFile = "/versions/" + sAppClass + "/" + sVersion + "/components.xsl";