title: Tracking down the source code line of a crash from a non-debug built module
body: <p>I have a widows crash-dump with a call stack showing me the <strong>module!functionname+offset</strong> of the function that caused the crash. The module is built <strong>without debug information</strong> using gcc.</p>
  
  <p>The cause of the crash is an exception caused by a failed to write at a given address, i.e access violation(05), write violation(01)</p>
  
  <p>On my development machine I have access to the same module built with debugging information. What I'm looking for is a way to track down the corresponding source code line that caused the crash, this by using the <strong>module!functionname+offset</strong> information as starting point.</p>
  
  <p>The method name of the top frame in the call stack is a class destructor
  The mangled function name is _ZN20ViewErrorDescriptionD0Ev+x79</p>
  
  <p>Running objdump -d  searching for the <strong>module!functionname+offset</strong> gives:</p>
  
  <pre><code>.... call *%eax 
  .... mov 0xffffffbc(%ebp), %eax
  .... cmpl 0x0, 0x148(%eax)
  </code></pre>
  
  <p>trying to find this in the debug built file gives no match</p>
  
  <p>The source code of the destructor only contains two delete pointerX calls.</p>
  
  <p>Using gdb to load the debug built module(sharedlibrary) and then calling <strong>info line </strong> gives me a starting and ending address, using grep on the objdump output shows the corresponding disassembled code, which looks quite much like the one from the module without debug info, but still far from the same.</p>
  
  <p>!NB - The output from info line says <strong>_ZN20ViewErrorDescriptionD2Ev</strong> not <strong>_ZN20ViewErrorDescriptionD0Ev</strong> as the crash dump says.</p>
  
  <p>Taken from the ABI documentation:
             ::= D1   # complete object destructor
             ::= D2   # base object destructor</p>
  
  <p>Where do I go from here?</p>
  
  <p>Best regards
  Kristofer H</p>