lua函数说明

debug.getinfo([thread],function[,what])

function,可以是一个数,0代表(getinfo),1代表调用getinfo的函数,如果超出调用堆栈函数返回nil.

what,可以是下面的字符或者它们的组合,getinfo将根据what来填充返回的表.

'n'填充name和namewhat字段

'S'填充source,short_src,linedefined,lastlinedefined和what

'l'填充currentline,函数当前执行.

'u' 填充nups,函数的upvalue数量.

'f'填充func,level对应的函数.

'L' pushes onto the stack a table whose indices are the numbers of the lines that are valid on the function. (A valid line is a line with some associated code, that is, a line where you can put a break point. Non-valid lines include empty lines and comments.) 


debug.getfunv(o)

返回对象o的环境.如果这样使用debug.getfunv(debug.getinfo(level,'f').func)就可以访问level的环境表.




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值