lua-users home
lua-l archive

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


> Good. Just a quick question (haven't read the above thread thoroughly 
> myself). Is possible to strip the debug information off the generated 
> bytecode?

There's C code and instructions for that in
	http://lua-users.org/lists/lua-l/2006-10/msg00011.html

> withDbgInfo = string.dump(aFunction)
> noDbgInfo = strip_debuf_info(withDbgInfo)
> 
> just by manipulating the byte stream?

You could do it in Lua but you'd have to parse the bytecode stream. Not fun.
On the other hand, in the current bytecode format, the debug info is the last
section dumped, and so if aFunction does not include other functions, it's
a matter of removing the tail of the bytecode string. The problem, of course,
is finding out where that tail starts...
--lhf