title: Is there a way to determine parameter values passed to a Lua function from within a call to the debug hook handling the 'call' event?
body: <p>I have written a Lua script that uses the debug API (<code>debug.sethook</code>) to hook calls and returns.  I use it to print out a nicely formatted call tree - which is very useful for debugging.</p>
  
  <p>In the hook handler function I increment or decrement a global <code>indentLevel</code> variable based on whether the event is 'call' or 'return' (or 'tail return').  I then use <code>debug.getinfo</code> to get info about the calling function and dump it to stdout at the current indent level.</p>
  
  <p>For 'call' events I would like to also print out the parameter values that were passed to the particular call.  Presumably I could do this in a C/C++ implementation of the hook handler function by looking at the Lua stack.  </p>
  
  <p>Does anyone know if there is a way to determine the parameter values from within the debug handler function in Lua?</p>