[CCC DEV] Things are working again except for the FFI stuff
Adam Sampson
ats at offog.org
Thu Jun 10 11:23:12 BST 2010
Dennis Meade <meade.dennis at gmail.com> writes:
> Any idea what "staus E" means?
It means that the Transterpreter virtual machine was explicitly put into
an error state -- for example, because the program did a division by
zero, or called CAUSEERROR (). Not very useful in itself...
I've just committed some changes to the Arduino wrapper that will make
it print a rather more verbose report when this sort of thing
happens. Here's an example:
tvm-arduino: error status E
Final machine state:
file=testfloat.occ line=13
wptr=01ec (rel=002d) iptr=d59d (rel=0569) eflags=0001 sflags=0000
areg=0004 breg=01f4 creg=01f4 oreg=0000
8000 0000 0000 d597 01f4 01ee 0001 wptr>d044 0000 0000 01fa 0000 0000 d03c
41 11 14 24 66 95 74 d1 75 d2 21 f0 iptr>25 64 42 21 fb 25 64 41 21 fb 25 64
The most useful bit here is "file=testfloat.occ line=13", which points
at the source file and line number where the error occurred. (Actually,
it'll sometimes point to the line *after* the one where the error
occurred, since the instruction pointer points to the *next* instruction
that'll be executed.) This is based on the debugging information that's
stored in the .tbc file; if it's not present it won't print that line.
The rest is a dump of most of the Transterpreter's registers, along with
the contents of the memory locations around the workspace pointer and
instruction pointer. This is probably not of much interest unless you're
planning on digging into the bytecode, but if you really want to know
more I've put some instructions here (which I wrote before realising
that implementing the file=/line= stuff above wasn't too difficult!):
http://projects.cs.kent.ac.uk/projects/kroc/trac/wiki/DebuggingTricks
Suggestions on how to make that output more useful and less scary would
be appreciated. ;-) A future Arduino-style environment could parse the
output itself and go to the right source line automatically.
Hope this helps,
--
Adam Sampson <ats at offog.org> <http://offog.org/>
More information about the developers
mailing list