Meminfo in stddebug.dg

Looking at the code of stddebug.dg, it seems that one can use a meminfo command while debugging. However, when I compile any one of my projects, I cannot get the command to do anything but return a blank line. In other respects it seems I am using stddebug.dg properly; I can teleport, for example.

Any thoughts?

2 Likes

Ah, I can see how this is confusing.

The meminfo command invokes a built-in predicate (display memory statistics) which prints a line of backend-specific statistics. The Z-machine and Å-machine backends provide useful information here, but the interactive debugger does not. So the command only works if you compile the story along with stddebug.

The rationale behind this is that the debugger does not use memory in the same way as compiled code, mainly to allow incremental updates and to be able to show more information during tracing. Therefore, statistics about memory usage in the debugger could potentially be misleading, and I reckoned that providing no information is better than providing bad information.

But a blank line is not helpful either, so I think I’ll add a stock response about this command not being available inside the debugger.

5 Likes

Oh yes, that makes sense. And I like the idea of extending the proposed kindness to the author. Thank you!

2 Likes