Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-4870

Python in GDB on windows is hardcoded to use 2.5

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • Qt Creator 2.3.0
    • Qt Creator 2.2.0, Qt Creator 2.2.1, Qt Creator 2.3.0, Qt Creator 2.4.0
    • Debugger
    • None
    • mingw on windows.

      in gdbengine.cpp, there is a hardcoded Python version, which seems orthogonal to these instructions on the Qt Wiki: http://developer.qt.nokia.com/wiki/QtCreatorBuildGdb

      I am trying to ship a mingw64 toolchain distribution that works out of the box with python enabled gdb. I followed the instructions in the link to the letter, but it seems QtCreator is not searching the correct directories. In the wiki article, this is the directory structure:

      /
      /bin
      /bin/gdb.exe
      /bin/python27.dll
      /lib
      /lib/python27
      /lib/python27/<all *.py files in their correct subdirectories from the python install>
      

      But apparently, QtCreator does not even look for this directory, but instead looks for this:

      /gdb.exe
      /python27.dll
      /python2.5
      /python2.5/lib
      /python2.5/lib/<all *.py files in their correct subdirectories from the python install>
      

      Which is ugly for an integrated toolchain (as lib should contain .a files for GCC and binutils) and doesn't match your detailed wiki article.

      Please note that the error message is extremely unhelpful, outright outdated and incorrect in the above case where I tried to set PYTHONPATH to everything that might work.

      What did work (and you strangely expect), is this:

      /bin
      /bin/gdb.exe
      /bin/python27.dll
      /bin/python2.5
      /bin/python2.5/lib
      /bin/python2.5/lib/<python 2.7 *.py files
      

      Please change the behavior so that QtCreator looks in

      <gdblocation>/../lib/python27/

      for this, as described and assumed in your wiki article. Of course PYTHONPATH should still be searched for other kinds of installs.

      UPDATE: Additionally, By experimenting with a debug version that outputs the string from this call in src/plugins/debugger/gdbengine.cpp:

      const QString environmentPythonPath = environment.value(pythonPathVariable);
      qDebug() << "PYTHONPATH = " << environmentPythonPath;
      

      I see in my console window that the string remains empty. I have tried setting PYTHONPATH via the "set" command and through QtCreator's Project pane. Both produce an empty string. This has to be fixed.

      Thanks!

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            dmolkent Daniel Molkentin (Inactive Nokia Account!) (Inactive)
            rubenvb Ruben Van Boxem
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes