title: GDB Python support, ImportError no module named gdb
body: <p>I am trying to compile gdb with python support so I can use the PrettyPrinters provided at :
  <a href="http://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python" rel="nofollow">http://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python</a></p>
  
  <p>I downloaded the latest gdb source from (<a href="http://ftp.gnu.org/gnu/gdb/gdb-7.6.1.tar.gz" rel="nofollow">http://ftp.gnu.org/gnu/gdb/gdb-7.6.1.tar.gz</a>) and compiled it on my Centos 6.4 as follows:
  1. ./configure --with-python
  2. make</p>
  
  <p>Do I need to provide a path or another argument to --with-python with the path to python libs or executable?</p>
  
  <p>After compilation when I run gdb, I see this warning:</p>
  
  <pre><code>Python Exception &lt;type 'exceptions.ImportError'&gt; No module named gdb:
  warning:
  Could not load the Python gdb module from `/usr/local/share/gdb/python'.
  Limited Python support is available from the _gdb module.
  Suggest passing --data-directory=/path/to/gdb/data-directory.
  </code></pre>
  
  <p>The exception is obvious here and whatever I am going to do next is going to fail because it needs the gdb module, but I gave it a try anyways. So I added the following lines to ~/.gdbinit:</p>
  
  <pre><code>import sys 
  
  sys.path.insert(0, '/tmp/pretty/python')
  from libstdcxx.v6.printers import register_libstdcxx_printers
  register_libstdcxx_printers (None)
  </code></pre>
  
  <p>Now when I start gdb, I get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 3, in &lt;module&gt;
    File "/tmp/pretty/python/libstdcxx/v6/printers.py", line 18, in &lt;module&gt;
      import gdb
  ImportError: No module named gdb
  Error while executing Python code.
  </code></pre>
  
  <p>Can someone help me resolve this issue?</p>