title: How to provide source-level debugging info when my compiler targets C
body: <p>I am working on a compiler that translate the source language into C. Then any C compiler could compile that into executable binary. </p>
  
  <p>Though C compiler can attach its own debugging information with the executable, however, those are C-level information. For example, the stack trace displays C functions and line numbers in C, instead of the source code functions and line numbers. </p>
  
  <p>I am pretty much concerned about the following debugging information available to users:</p>
  
  <ol>
  <li>Stack trace of source-level function/line/file name, etc. </li>
  <li>Value of variables to be printed as source-level value</li>
  </ol>
  
  <p>What is the common approach to this when a compiler targets C?</p>
  
  <p>I am looking at GDB's pretty printer. Will that be a possible solution to me?</p>