Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Error when trying to attach GDB to project

    Installation and Deployment
    3
    4
    219
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      alex1 last edited by alex1

      Getting this error when I try to attach the debugger to a C++ project - "The selected build of GDB supports Python scripting, but the used version 0.0 is not sufficient for Qt Creator. Supported versions are Python 2.7 and 3.x."

      I have python 2.x and 3.x installed already. Running on Fedora 29.
      Qt Creator version - 4.11.2.
      GDB version - Fedora 8.2-3.fc29
      gcc version - 8.3.1 20190223

      qt_creator_error.png

      Pablo J. Rogina 1 Reply Last reply Reply Quote 0
      • Pablo J. Rogina
        Pablo J. Rogina @alex1 last edited by

        @alex1 that error comes from method GdbEngine::handlePythonSetup in Qt Creator source code.

        You may want to check why your GDB setup reports Python version as 0.0 back to Qt Creator

         GdbMi data = response.data;
                watchHandler()->addDumpers(data["dumpers"]);
                m_pythonVersion = data["python"].toInt();
                if (m_pythonVersion < 20700) {
                    int pythonMajor = m_pythonVersion / 10000;
                    int pythonMinor = (m_pythonVersion / 100) % 100;
        

        You may find more information about Qt Creator and GDB interaction here.

        Additionally, you may want to contact the Qt Creator mailing list

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 0
        • A
          alex1 last edited by

          Thanks for the info.

          I don't know how to check why GDB setup reports python version as 0.0, I don't really have the skill level to dig into the Qt Creator source code and find out how it works. I did find this link for a bug report that was filed from someone a few years ago. Seems releated. No actionable info in there for me to solve my problem though.
          https://bugreports.qt.io/browse/QTCREATORBUG-17659?focusedCommentId=345304&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel

          1 Reply Last reply Reply Quote 0
          • M
            mgrabner last edited by

            I came across the same issue and noticed that the reason was the line "set trace-commands on" in my "~/.gdbinit" file. This seems to modify the output of gdb such that parsing the python version number fails. Therefore I suggest:
            *) Qt creator users should make sure that the "trace-commands" feature in gdb is disabled.
            *) Qt creator developers should explicitly switch off the "trace-commands" feature after establishing the connection with gdb or modify the parser such that it can deal with the additional trace output.

            Hope that helps (at least it does for me),
            Markus

            1 Reply Last reply Reply Quote 0
            • First post
              Last post