zarf
(Andrew Plotkin)
June 1, 2014, 8:26pm
1
As I mentioned in a blog post last night, I’ve been on-and-off working on a low-level debugger module for the Glulxe interpreter.
It doesn’t do a lot and it’s currently only accessible with CheapGlk. See below for a sample transcript.
This is not yet released; the code exists in branches in my CheapGlk and Glulxe repositories. See:
github.com/erkyrath/cheapglk/bl … gi_debug.h
github.com/erkyrath/glulxe/blob … debugger.c
If you want to implement the debug interface for another Glk library, go for it. I am currently (slowly) putting it into RemGlk. I don’t expect the gi_debug.h interface to change, but don’t consider it absolutely finalized either.
This is an I6-level debugger. It makes use of the “gameinfo.dbg” file, which is automatically generated in an I7 build (unless you’ve turned off that option in the Windows IDE). It will not be very useful to an I7 author, unless you’re comfortable diving down into the I6 layer of your game code.
% glulxedebugc -D --starttrap Advent.ulx --gameinfo Advent.dbg
Welcome to the Cheap Glk Implementation, library version 1.0.4. Debug support is on.
Debug: Break at start:
Debug: Main__() (pc=$3F)
Debug: (no locals)
break XyzzySub
Debug: Breakpoint set for function: 103587 ($194A3), XyzzySub()
cont
Debug: Continuing…
Welcome to Adventure!
ADVENTURE
The Interactive Original
By Will Crowther (1973) and Don Woods (1977)
Reconstructed in three steps by:
Donald Ekman, David M. Baggett (1993) and Graham Nelson (1994)
[In memoriam Stephen Bishop (1820?-1857): GN]
Release 5 / Serial number 961209 / Inform v6.33 Library 6/11 SD
At End Of Road
You are standing at the end of a road before a small brick building. Around you is a forest. A small stream flows out of the building and down a gully.
i
You are carrying nothing.
xyzzy
Debug: Breakpoint:
Debug: XyzzySub() (pc=$194A6)
Debug: (no locals)
bt
Debug: XyzzySub() (pc=$194A6)
Debug: (no locals)
Debug: ActionPrimitive() (pc=$AD8E)
Debug: (no locals)
Debug: InformLibrary.begin_action() (pc=$ABB4)
Debug: a=98 ($62); n=0; s=0; source=0; sa=98 ($62); sn=0; ss=0
Debug: CA__Pr() (pc=$19E25)
Debug: vararg_count=4; obj=165793 ($287A1), InformLibrary; id=269 ($10D); zr=1; s=0; s2=0; z=0; addr=175676 ($2AE3C); len=4; m=0; val=43874 ($AB62), InformLibrary.begin_action()
Debug: InformLibrary.play() (pc=$A939)
Debug: i=0; j=98 ($62); k=0; l=0
Debug: CA__Pr() (pc=$19E25)
Debug: vararg_count=0; obj=165793 ($287A1), InformLibrary; id=267 ($10B); zr=1; s=0; s2=0; z=0; addr=175668 ($2AE34); len=4; m=0; val=42084 ($A464), InformLibrary.play()
Debug: Main() (pc=$5B)
Debug: (no locals)
Debug: Main () (pc=$46)
Debug: (no locals)
print location
Debug: global location = 165953 ($28841), At_End_Of_Road