Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Error when trying to attach GDB to project
Forum Update on Monday, May 27th 2025

Error when trying to attach GDB to project

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 3 Posters 872 Views
  • 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 Offline
    A Offline
    alex1
    wrote on 26 Aug 2020, 16:40 last edited by alex1
    #1

    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

    P 1 Reply Last reply 26 Aug 2020, 19:16
    0
    • A alex1
      26 Aug 2020, 16:40

      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

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 26 Aug 2020, 19:16 last edited by
      #2

      @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
      0
      • A Offline
        A Offline
        alex1
        wrote on 27 Aug 2020, 00:53 last edited by
        #3

        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
        0
        • M Offline
          M Offline
          mgrabner
          wrote on 28 Jul 2022, 21:34 last edited by
          #4

          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
          0
          • K koahnig referenced this topic on 27 Jul 2023, 07:20

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved