Difficulties in using ftransfer/ntransfer.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Difficulties in using ftransfer/ntransfer.

actboy168@gmail.com

The parameters of the function can only be obtained in the call hook. But the actual use of it is usually in the line hook, such as the breakpoint hit to see what parameters of the function. Now I want to do this, I need to activate the call hook at any time and record the number of arguments to all the functions on the call stack. This can seriously affect performance.

Is it possible to make ftransfer/ntransfer valid in line hook?

 

 

--actboy168

 

Reply | Threaded
Open this post in threaded view
|

Re: Difficulties in using ftransfer/ntransfer.

Roberto Ierusalimschy
>    The parameters of the function can only be obtained in the call hook.  But
>    the actual use of it is usually  in the line hook, such as the  breakpoint
>    hit to see what parameters of the function. Now I want to do this, I  need
>    to activate the call hook at any  time and record the number of  arguments
>    to all  the  functions  on  the call  stack.  This  can  seriously  affect
>    performance.
>
>    Is it possible to make ftransfer/ntransfer valid in line hook?

For parameters, ftransfer is always 1; you can get ntransfer with
the expression 'debug.getinfo(1, 'u').nparams'.

-- Roberto