[Scummvm-git-logs] scummvm master -> 20281859fa6655530fdd06bff32223109111ec46

sev- noreply at scummvm.org
Sun Nov 5 18:18:34 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
20281859fa SLUDGE: Print more of execution state


Commit: 20281859fa6655530fdd06bff32223109111ec46
    https://github.com/scummvm/scummvm/commit/20281859fa6655530fdd06bff32223109111ec46
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-11-05T19:18:10+01:00

Commit Message:
SLUDGE: Print more of execution state

Changed paths:
    engines/sludge/function.cpp


diff --git a/engines/sludge/function.cpp b/engines/sludge/function.cpp
index 8fd1d75e1e7..b2b652e6510 100644
--- a/engines/sludge/function.cpp
+++ b/engines/sludge/function.cpp
@@ -74,6 +74,16 @@ void printStack(VariableStack *ptr) {
 	debug("");
 }
 
+void printLocals(Variable *localVars, int count) {
+	if (count == 0)
+		debugN("<none>");
+
+	for (int i = 0; i < count; i++)
+		localVars[i].debugPrint();
+
+	debug("");
+}
+
 void restartFunction(LoadedFunction *fun) {
 	fun->next = allRunningFunctions;
 	allRunningFunctions = fun;
@@ -208,9 +218,15 @@ bool continueFunction(LoadedFunction *fun) {
 		param = fun->compiledLines[fun->runThisLine].param;
 		com = fun->compiledLines[fun->runThisLine].theCommand;
 
-		debugN("Stack before: ");
+		debugN("  Stack before: ");
 		printStack(fun->stack);
 
+		debugN("  Reg before: ");
+		debug("");
+
+		debugN(" Locals before: ");
+		printLocals(fun->localVars, fun->numLocals);
+
 		debugC(1, kSludgeDebugStackMachine, "Executing command line %i: %s(%s)", fun->runThisLine, sludgeText[com], getCommandParameter(com, param).c_str());
 
 		if (numBIFNames) {
@@ -637,9 +653,15 @@ bool continueFunction(LoadedFunction *fun) {
 			return fatal(ERROR_UNKNOWN_CODE);
 		}
 
-		debugN("Stack after: ");
+		debugN("  Stack after: ");
 		printStack(fun->stack);
 
+		debugN("  Reg after: ");
+		debug("");
+
+		debugN(" Locals after: ");
+		printLocals(fun->localVars, fun->numLocals);
+
 		if (advanceNow)
 			fun->runThisLine++;
 




More information about the Scummvm-git-logs mailing list