title: Ctypes - getting a C backtrace from python code which uses ctypes
body: <p>I'm trying to debug code where python calls a C function using ctypes. The line in the python code I'm interested in looks something like:</p>
  
  <pre><code>returnValue = cfunction()
  </code></pre>
  
  <p>where cfunction is a C function. I want to know where in the cfunction code the cfunction returned from. How can I do this? </p>
  
  <p>It looks like I can use gdb with python, but I'm not sure the right way to use gdb so I can set a breakpoint at the above line and show where the C function returned from in the C code. Of course I have the C code compiled with -g.</p>
  
  <p>It's not a requirement that I use gdb for this, as long as I can do it with some free (as in beer or speech) tool in Linux.</p>
  
  <p>(I'm running python 2.7.6, gdb 7.7, and the C code is compiled with gcc 4.8.2.)</p>