lua-users home
lua-l archive

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


于 2013-12-4 13:51, vizouk 写道:
Hi is there any way to override a function and still get the result of:

debug.getinfo(SPrint).linedefined == -1 ?

I want to override an function but still bypass the check of debug.getinfo
oterhwise or can i override debug.getinfo ?


Regards



--
View this message in context: http://lua.2524044.n2.nabble.com/Override-debug-info-or-bypass-linedefined-tp7654914.html
Sent from the Lua-l mailing list archive at Nabble.com.


I guess you already had the idea that I would like to suggest:

When you replace the routine, store a map between the original one and the new one.
And hook the debug function too, in the way that it first looks up in the map to see if the
function being queried is hooked, and return the info accordingly.