[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: No filenames in traceback, only 'string ["..."]'
- From: Devon Strawn <strawn@...>
- Date: Mon, 3 Jan 2011 11:44:30 -0800
(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?