A production Muq compiler needs to do more than generate code that executes successfully: It should also document that code well enough to support symbolic debugging, including:
We have already seen that the names of local variables
may be documented via assembleVariableSlot
,
and that the name of the function may be documented
by setting fun$s.name
. The remaining items
may be recorded as follows:
asm$s.fileName
: The assembler will
copy it to fun$s.fileName
. You may
also set the latter directly.
asm$s.file-line
: The assembler will
copy it to fun$s.fileLine
. You may
also set the latter directly. Note that
the first line in the file is line zero,
for this purpose.
fun$s.source
.
asm$s.line-number
. This may be set directly, or
via assemble-line-number
, which is somewhat
faster. This information winds up in
fun$s.lineNumbers
, but you shouldn't manipulate
the latter directly, as its format is likely to change
in future releases. These line numbers should start at
zero for the first line of code in the function: If the
line number within the source file is later desired,
fun$s.fileLine
may be added in.
Go to the first, previous, next, last section, table of contents.