[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: something about strip debug information
- From: cloudwu <cloudwu@...>
- Date: Thu, 16 Feb 2006 18:33:21 +0800
Thursday, February 16, 2006, 5:19:44 PM, you wrote:
>> In lua 5.1 , I found we can use luac -s to strip debug
>> information . But why the source file name is still in the
>> binary block ?
LHdF> Lua needs a filename for error messages. We could replace the original
LHdF> filename by "?" or something like that, but filenames do not take much
LHdF> space anyway in precompiled chunks (they appear once only).
LHdF> Do you *need* to remove filenames?
Some simple modules never throw error messages or I don't care the
error messages. These modules are really small, and the string of filename with
path is longer than module's bytecodes.
Since I strip the debug information, usually I don't care the error
Another reason is, I want to publish some modules in bytecodes sometimes, and I don't
want to the pathname string exsits in the module block for some reason.
So I think let us have some way the strip this string would be better.
I read the lundump.c and saw
Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name)
if (*name=='@' || *name=='=')
else if (*name==LUA_SIGNATURE)
the name can be the "\0", doesn't it?