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

Debuging with "Run in terminal" does not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: Qt Creator 5.0.1
    • Fix Version/s: Qt Creator 5.0.2
    • Component/s: Debugger
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      76760d8d80b45905e719cf4220bd8ef0798d0c41

      Description

      "Start debugging of startup project" with a project with "Run in terminal" checked fails with message box "Command aborted" with Title "Executable Failed - Qt..."
       
      The problem appeared after upgrading qtcreator from 4.14.1 to 5.0.1
      Going back to 4.14.1 resolves the issue.
       
      To reproduce:
       
      New project -> Application (Qt) -> Qt Console Application
      Build system qmake, next, next, ...
      (the standard kit x64, no cross compiling)
       
      The qtcreator will create a simple app with main.cpp and a pro file.

      Place a breakpoint wherever within int main and press "Start debugging of startup project". At this point everything works as expected: the program hits the breakpoint

      Now choose: Project -> <Your kit> -> Run and check "Run in terminal" and try to debug again. You will get a popup saying "Command aborted" with Title "Executable Failed - Qt..."

      The debugger log yields:
      -------------------------------------
      (...)

      &"Warning:\n"

      >&"Cannot insert breakpoint 1.\n"

      >&"Cannot access memory at address 0x1205\n"

      >&"\n"

      >70^error,msg="Command aborted."

      dCOOKIE FOR TOKEN 70 ALREADY EATEN (InferiorRunOk). TWO RESPONSES FOR ONE COMMAND?

      dNOTE: INFERIOR SPONTANEOUS STOP

      Stopped.

      dState changed from InferiorRunOk(7) to InferiorStopOk(10)

      Executable failed: Command aborted.

       

      >&"p 0\n"

      >~"$1 = 0\n"

      >^done

      dCOOKIE FOR TOKEN 0 ALREADY EATEN (InferiorStopOk). TWO RESPONSES FOR ONE COMMAND?
      -------------------------------------

      I can reproduce it on both Ubuntu 18.04 and 20.04 and also on kubuntu 18.04.All with distribution default GDB and gcc/g++.

      Affected version of QT creator: 5.0.1
      Switching back to 4.14.1 solves the problem.

      My system GDB (on ubuntu 20.04) is 9.2. I thought that it may be an issue with GDB so I have tried some older one (8.1.1) but the problem persists.
      One may find it interesting that by default the binary created by the gcc with default .pro file is:

      untitled: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=3e415d6a4d24ef946d2b4418657a50680db34ca5, for GNU/Linux 3.2.0, with debug_info, not stripped
       
      and in the case above (shared object) the problem exists.
       
      If one adds to the .pro file QMAKE_LFLAGS += -no-pie and rebuild we get:

      untitled: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=46458e9cf4c5b29d6259edfb2875b9589d54822d, for GNU/Linux 3.2.0, with debug_info, not stripped

      And now the debugging works even with 5.0.1 however only if the project does not consist of any shared library subprojects (I meam TEMPLATE = subdirs and some shared library and main program witging the project).

       

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              hjk hjk
              Reporter:
              casper Krzysztof Kasperski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes