I’m not looking for anything massively overengineered here, it could be as simple as a text file that maps the obvious things to strings:
Object numbers to object names
Property numbers to property names
Attribute numbers to attribute names
Global variable indices to global names
and most importantly, address ranges to a file name and line number.
(Note, I did not say Inform, because I’m not using Inform. But something that some interpreters already support would be handy otherwise I’ll just roll something up for my own runtime and interpreter)
Basically, I’m getting tired of the z machine crashing from a bad object index or whatever and having to manually figure out what address maps to the source line in the disassembly.
The only “standards” are the debug output that Inform 6 generates and the debug output that ZILF generates.
(The I6 debug format could be described as “massively overengineered”. :)
If you’re testing the Infocom game files, it is useful to look at Reform: Index: if-archive/infocom/tools/reform . The reform_infocom_symfiles.zip file contains object/address/etc info for all the Infocom releases.
Your Visible Zork series kinda works as a really nice debugger
How many interpreters actually support either or both of these formats? Eventually I’m going to need to test my story files on “real” interpreters and not just my own.
(My interpreter passes all the compliance tests I could find, thanks to people here who pointed me at them, but still produces a bizarre “programming error” from the Inform library when I play Lost Pig. Sigh)
EDIT - looks like the reform format you mentioned is in the ballpark. It doesn’t seem to have line number support though, unless that’s just not available for the Infocom stories but the format actually does support it.
I’ve thought about writing a script to match up the ZIL code for a function against the disassembly dump of the same function and pull out line numbers for every opcode. Then I decided not to.
ZILF uses Inform’s debug formats. The older binary format, which ConsoleZLR requires, is documented in the Inform 6 Technical Manual. ZILF also theoretically supports the newer XML format, documented here, but it hasn’t been tested much.
I while back I made WinZLR that uses ConsoleZLR and UnZ for debugging code both from Inform6/Zilf source code and from disassembled z-code. It also have code for converting Inform6’s XML debuginfo to the binary format. The project is in C# and only for Windows (uses WinForms).
Not sure anybody here will know the answer to this offhand, but do existing implementations assume the routine indices are consecutive from zero?
In my debug information, the routine indices are unique but not consecutive for boring internal reasons.
(Boring reason - I use std::map’s for all the debug tables, and the system in the compiler that manages relocatable objects handles more than just routines, so the ones that are routines have no particular numbering)