title: How to get function return address within function?
body: <p>I want to print return value in my tracer, there are two questions</p>
  
  <ol>
  <li>How to get return address ?</li>
  <li>The return position is updated before OR after ~Tracer() ?</li>
  </ol>
  
  <p>Need text here so Stackoverflow formats the code:</p>
  
  <pre><code>struct Tracer
  {
    int* _retval;
    ~Tracer() 
    { printf("return value is %d", *_retval); }
  };
  
  
  int foo()
  {
    Tracer __tracter = { __Question_1_how_to_get_return_address_here__ };
  
    if(cond) {
       return 0;
    } else {
       return 99;
    }
  
    //Question-2: 
    // return postion is updated before OR after ~Tracer() called ???
  }
  </code></pre>