lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I was pleased to get an email from a man who wanted to introduce
his son to programming using Lua. He ended his email with:

> Anyway, my conclusion is this would be a good way to introduce my son to
> programming, but the main obstacle is the debugging!  Throwback into the
> editor would be ideal, if that could be arranged.

RISC OS has a module, DDEUtils, which makes throwback very straightforward.
To use it, I need to define a function with a prototype

void throw (const char *filename, int linenumber, const char *message);

This I have done (using ARM assembler) and tested. I get a window
opening showing the message, which when clicked on opens the file
specified by filename at line number linenumber. OK so far.

I have been going through the Lua sources trying to understand what
happens when an error is raised. The difficulty, from my point of
view, is that the various error functions appear to be simply concatenating
lots of error messages. But I need an error datatype

typedef struct err {
   char *filename; int linenumber; char *message; } err;

not just char *message;. I need to extract the requisite filename and
linenumber. Am I trying to squeeze my big foot into a glass slipper here?
Any helpful tips would be much appreciated.

-- 
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/