lua-users home
lua-l archive

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

(Lua 5.1.4 on Windows)

I'm loading pre-compiled bytecode via luaL_loadbuffer(), passing the original source's filename as the 'name' parameter. But error tracebacks show the literal 'string ["..."]' instead of the expected filename.  It's as if the 'name' parameter is ignored when loading bytecode in this fashion.  This slows down debugging, b/c I only have function names to locate bugs.

I experimented with one possible solution, but this did not solve the problem:

1) Tried prepending '@' or '=' to 'name' argument (this is a hint to Lua that the 'name' indicates a file, as far as I can tell).  However, this doesn't change anything, the traceback still shows 'string ["..."]'.

I realize there are several trivial solutions to this problem if I change my design (i.e., load source code instead of bytecode); however, I want to understand how to fix this problem with my current design (loading pre-compiled bytecode).

How can I solve this problem and obtain proper filenames in traceback?