<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I need some advice on "forwarding" arguments to a callee. Suppose I
    have a function F that is called at the beginning of all other
    functions in the module. From F I need to access (read) the
    arguments passed to its immediate caller. Right now I do something
    like boxing all arguments in the caller inside a struct and passing
    a pointer to the struct to F, alongside an identifier telling which
    caller F is being called from. F has then a giant switch that
    branches to the appropriate unboxing code. This is obviously
    suboptimal because I need to allocate the struct on the stack, copy
    the arguments inside of it and then passing an additional pointer to
    F.<br>
    I was wondering if there's a better way to do this, e.g. a way to
    access the stack frame of the caller (knowing, thanks to the
    identifier, which caller F was called from) or, more in general,
    arbitrary values defined in the caller. Any suggestions?<br>
  </body>
</html>