title: How to map a function name and line number by a memory address in C language?
body: <p>how can you map back function name and line number with a memory address in GCC ?</p>
  
  <p>i.e assuming a prototype in C language:</p>
  
  <pre><code>void func() {
    // Get the address of caller , maybe this could be avoided
    MemoryAddress = get_call_address();
  
    // Which line from source code is executing , which calls func()
    LineNumber = get_lineno_from_symbol ( &amp;MemoryAddress );
  
    // Grab the name who calls func()
    FunctionName = get_func_from_symbol ( &amp;MemoryAddress );
  }
  </code></pre>
  
  <p>So is there any existing APIs provided by GCC or whatever , that can meet my requirements ?</p>
  
  <p>Many thanks for any of you response ;-P</p>