Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Debugger doesn't hit breakpoints
QtWS25 Last Chance

Debugger doesn't hit breakpoints

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
creatordebugger
9 Posts 3 Posters 6.4k 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.
  • D Offline
    D Offline
    Daniele_B
    wrote on 13 Oct 2017, 20:23 last edited by A Former User
    #1

    I've read tons of threads with this title to solve my problem but no one worked.

    My problem is easy: everytime i create a Non-QT project (only with Non-QT) debugger doesn't hit breakpoints.
    I tried to see if my project was in release mode but it wasn't.
    I tried to see if g++ added -g option.
    I tried to erase "user.pro" file, clean all and rebuild it.
    I Thought was gdb, so tried to do manual debugging, but manual debugging doesn't have any problem with breakpoints...

    What else should i do in order to check if there is something wrong?

    I'm currently using QT Creator 4.0.2 (QT 5.7.0) with Debian (Linux).

    [Moved to Tools ~kshegunov]

    K 1 Reply Last reply 13 Oct 2017, 20:58
    0
    • D Daniele_B
      13 Oct 2017, 20:23

      I've read tons of threads with this title to solve my problem but no one worked.

      My problem is easy: everytime i create a Non-QT project (only with Non-QT) debugger doesn't hit breakpoints.
      I tried to see if my project was in release mode but it wasn't.
      I tried to see if g++ added -g option.
      I tried to erase "user.pro" file, clean all and rebuild it.
      I Thought was gdb, so tried to do manual debugging, but manual debugging doesn't have any problem with breakpoints...

      What else should i do in order to check if there is something wrong?

      I'm currently using QT Creator 4.0.2 (QT 5.7.0) with Debian (Linux).

      [Moved to Tools ~kshegunov]

      K Offline
      K Offline
      koahnig
      wrote on 13 Oct 2017, 20:58 last edited by
      #2

      @Daniele_B

      Hi and welcome to devnet forum

      Typically this happens when the source is not compiled for debugging or the linker removes debug information.

      First you should check with "top", if the debugger is started when you hit run.
      Also you should find the proper compile and linkage flags in the "Compile output" pane of creator.

      Easiest do all this it is probably easiest to start out with a fresh non-Qt application through the new project template. Just generate a "hello world" program for this test.

      Vote the answer(s) that helped you to solve your issue(s)

      D 1 Reply Last reply 13 Oct 2017, 21:26
      1
      • K koahnig
        13 Oct 2017, 20:58

        @Daniele_B

        Hi and welcome to devnet forum

        Typically this happens when the source is not compiled for debugging or the linker removes debug information.

        First you should check with "top", if the debugger is started when you hit run.
        Also you should find the proper compile and linkage flags in the "Compile output" pane of creator.

        Easiest do all this it is probably easiest to start out with a fresh non-Qt application through the new project template. Just generate a "hello world" program for this test.

        D Offline
        D Offline
        Daniele_B
        wrote on 13 Oct 2017, 21:26 last edited by Daniele_B
        #3

        @koahnig
        Hi!
        Thank you for your answer.

        I made a new non-qt project, but nothing changed. This is the compile output (project name is "Secondaprova"):

        23:20:23: Running steps for project Secondaprova...
        23:20:23: Configuration unchanged, skipping qmake step.
        23:20:23: Starting: "/usr/bin/make" 
        g++ -c -pipe -g -std=gnu++11 -Wall -W -fPIC -DQT_QML_DEBUG -I../Secondaprova -I. -I/opt/Qt5.7.0/5.7/gcc_64/mkspecs/linux-g++ -o main.o ../Secondaprova/main.cpp
        g++  -o Secondaprova main.o    
        23:20:23: The process "/usr/bin/make" exited normally.
        23:20:23: Elapsed time: 00:00.
        

        I tried also to see if gdb started with "top" shell command, i can confirm gdb starts when i hit debug button.

        K 1 Reply Last reply 14 Oct 2017, 01:40
        0
        • D Daniele_B
          13 Oct 2017, 21:26

          @koahnig
          Hi!
          Thank you for your answer.

          I made a new non-qt project, but nothing changed. This is the compile output (project name is "Secondaprova"):

          23:20:23: Running steps for project Secondaprova...
          23:20:23: Configuration unchanged, skipping qmake step.
          23:20:23: Starting: "/usr/bin/make" 
          g++ -c -pipe -g -std=gnu++11 -Wall -W -fPIC -DQT_QML_DEBUG -I../Secondaprova -I. -I/opt/Qt5.7.0/5.7/gcc_64/mkspecs/linux-g++ -o main.o ../Secondaprova/main.cpp
          g++  -o Secondaprova main.o    
          23:20:23: The process "/usr/bin/make" exited normally.
          23:20:23: Elapsed time: 00:00.
          

          I tried also to see if gdb started with "top" shell command, i can confirm gdb starts when i hit debug button.

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 14 Oct 2017, 01:40 last edited by
          #4

          Check this one: https://forum.qt.io/topic/74646/qt-creator-fails-to-map-breakpoints-sometimes
          And if it doesn't solve it for you, post the debugger log here so we can see what's going on.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          1
          • D Offline
            D Offline
            Daniele_B
            wrote on 14 Oct 2017, 09:42 last edited by
            #5

            This is what Debug Log shows:

            1show version
            2show debug-file-directory
            3set print object on
            4set breakpoint pending on
            5set print elements 10000
            6handle SIGSEGV nopass stop print
            7set unwindonsignal on
            8set width 0
            9set height 0
            10set substitute-path /var/tmp/qt-src /opt/Qt5.7.0/5.7/gcc_64
            11-interpreter-exec console "set auto-solib-add on"
            12python sys.path.insert(1, '/opt/Qt5.7.0/Tools/QtCreator/share/qtcreator/debugger/')
            13python sys.path.append('/usr/bin/data-directory/python')
            14python from gdbbridge import *
            15python theDumper.loadDumpers({"token":15})
            16-interpreter-exec console "set target-async off"
            17-break-insert  -f "\"main.cpp\":7"
            18attach 1618
            19-exec-continue
            20-exec-continue
            21-exec-continue
            22python theDumper.exitGdb({"token":22})
            23show version
            24show debug-file-directory
            25set print object on
            26set breakpoint pending on
            27set print elements 10000
            28handle SIGSEGV nopass stop print
            29set unwindonsignal on
            30set width 0
            31set height 0
            32set substitute-path /var/tmp/qt-src /opt/Qt5.7.0/5.7/gcc_64
            33-interpreter-exec console "set auto-solib-add on"
            34python sys.path.insert(1, '/opt/Qt5.7.0/Tools/QtCreator/share/qtcreator/debugger/')
            35python sys.path.append('/usr/bin/data-directory/python')
            36python from gdbbridge import *
            37python theDumper.loadDumpers({"token":37})
            38-interpreter-exec console "set target-async off"
            39-break-insert  -f "\"main.cpp\":8"
            40attach 1743
            41-exec-continue
            42-exec-continue
            43-exec-continue
            44python theDumper.exitGdb({"token":44})
            45show version
            46show debug-file-directory
            47set print object on
            48set breakpoint pending on
            49set print elements 10000
            50handle SIGSEGV nopass stop print
            51set unwindonsignal on
            52set width 0
            53set height 0
            54set substitute-path /var/tmp/qt-src /opt/Qt5.7.0/5.7/gcc_64
            55-interpreter-exec console "set auto-solib-add on"
            56python sys.path.insert(1, '/opt/Qt5.7.0/Tools/QtCreator/share/qtcreator/debugger/')
            57python sys.path.append('/usr/bin/data-directory/python')
            58python from gdbbridge import *
            59python theDumper.loadDumpers({"token":59})
            60-interpreter-exec console "set target-async off"
            61-break-insert  -f "\"main.cpp\":8"
            62-break-insert  -f "\"main.cpp\":7"
            63attach 1836
            64-exec-continue
            65-exec-continue
            66-exec-continue
            67python theDumper.exitGdb({"token":67})
            68show version
            69show debug-file-directory
            70set print object on
            71set breakpoint pending on
            72set print elements 10000
            73handle SIGSEGV nopass stop print
            74set unwindonsignal on
            75set width 0
            76set height 0
            77set substitute-path /var/tmp/qt-src /opt/Qt5.7.0/5.7/gcc_64
            78-interpreter-exec console "set auto-solib-add on"
            79python sys.path.insert(1, '/opt/Qt5.7.0/Tools/QtCreator/share/qtcreator/debugger/')
            80python sys.path.append('/usr/bin/data-directory/python')
            81python from gdbbridge import *
            82python theDumper.loadDumpers({"token":82})
            83-interpreter-exec console "set target-async off"
            84-break-insert  -f "\"main.cpp\":8"
            85-break-insert  -f "\"main.cpp\":7"
            86attach 2003
            87-exec-continue
            88-exec-continue
            89-exec-continue
            90python theDumper.exitGdb({"token":90})
            
            K 1 Reply Last reply 16 Oct 2017, 08:41
            0
            • D Daniele_B
              14 Oct 2017, 09:42

              This is what Debug Log shows:

              1show version
              2show debug-file-directory
              3set print object on
              4set breakpoint pending on
              5set print elements 10000
              6handle SIGSEGV nopass stop print
              7set unwindonsignal on
              8set width 0
              9set height 0
              10set substitute-path /var/tmp/qt-src /opt/Qt5.7.0/5.7/gcc_64
              11-interpreter-exec console "set auto-solib-add on"
              12python sys.path.insert(1, '/opt/Qt5.7.0/Tools/QtCreator/share/qtcreator/debugger/')
              13python sys.path.append('/usr/bin/data-directory/python')
              14python from gdbbridge import *
              15python theDumper.loadDumpers({"token":15})
              16-interpreter-exec console "set target-async off"
              17-break-insert  -f "\"main.cpp\":7"
              18attach 1618
              19-exec-continue
              20-exec-continue
              21-exec-continue
              22python theDumper.exitGdb({"token":22})
              23show version
              24show debug-file-directory
              25set print object on
              26set breakpoint pending on
              27set print elements 10000
              28handle SIGSEGV nopass stop print
              29set unwindonsignal on
              30set width 0
              31set height 0
              32set substitute-path /var/tmp/qt-src /opt/Qt5.7.0/5.7/gcc_64
              33-interpreter-exec console "set auto-solib-add on"
              34python sys.path.insert(1, '/opt/Qt5.7.0/Tools/QtCreator/share/qtcreator/debugger/')
              35python sys.path.append('/usr/bin/data-directory/python')
              36python from gdbbridge import *
              37python theDumper.loadDumpers({"token":37})
              38-interpreter-exec console "set target-async off"
              39-break-insert  -f "\"main.cpp\":8"
              40attach 1743
              41-exec-continue
              42-exec-continue
              43-exec-continue
              44python theDumper.exitGdb({"token":44})
              45show version
              46show debug-file-directory
              47set print object on
              48set breakpoint pending on
              49set print elements 10000
              50handle SIGSEGV nopass stop print
              51set unwindonsignal on
              52set width 0
              53set height 0
              54set substitute-path /var/tmp/qt-src /opt/Qt5.7.0/5.7/gcc_64
              55-interpreter-exec console "set auto-solib-add on"
              56python sys.path.insert(1, '/opt/Qt5.7.0/Tools/QtCreator/share/qtcreator/debugger/')
              57python sys.path.append('/usr/bin/data-directory/python')
              58python from gdbbridge import *
              59python theDumper.loadDumpers({"token":59})
              60-interpreter-exec console "set target-async off"
              61-break-insert  -f "\"main.cpp\":8"
              62-break-insert  -f "\"main.cpp\":7"
              63attach 1836
              64-exec-continue
              65-exec-continue
              66-exec-continue
              67python theDumper.exitGdb({"token":67})
              68show version
              69show debug-file-directory
              70set print object on
              71set breakpoint pending on
              72set print elements 10000
              73handle SIGSEGV nopass stop print
              74set unwindonsignal on
              75set width 0
              76set height 0
              77set substitute-path /var/tmp/qt-src /opt/Qt5.7.0/5.7/gcc_64
              78-interpreter-exec console "set auto-solib-add on"
              79python sys.path.insert(1, '/opt/Qt5.7.0/Tools/QtCreator/share/qtcreator/debugger/')
              80python sys.path.append('/usr/bin/data-directory/python')
              81python from gdbbridge import *
              82python theDumper.loadDumpers({"token":82})
              83-interpreter-exec console "set target-async off"
              84-break-insert  -f "\"main.cpp\":8"
              85-break-insert  -f "\"main.cpp\":7"
              86attach 2003
              87-exec-continue
              88-exec-continue
              89-exec-continue
              90python theDumper.exitGdb({"token":90})
              
              K Offline
              K Offline
              kshegunov
              Moderators
              wrote on 16 Oct 2017, 08:41 last edited by
              #6

              This

              50 handle SIGSEGV nopass stop print
              

              shouldn't be there I believe. What code are you testing with? An empty project? Do you have global variables that could be segfaulting before you enter main?

              Read and abide by the Qt Code of Conduct

              D 1 Reply Last reply 16 Oct 2017, 16:05
              0
              • K kshegunov
                16 Oct 2017, 08:41

                This

                50 handle SIGSEGV nopass stop print
                

                shouldn't be there I believe. What code are you testing with? An empty project? Do you have global variables that could be segfaulting before you enter main?

                D Offline
                D Offline
                Daniele_B
                wrote on 16 Oct 2017, 16:05 last edited by
                #7

                @kshegunov I'm testing a standard "hello world" program, but gdb doesn't hit breakpoints with any code...

                K 1 Reply Last reply 16 Oct 2017, 16:12
                0
                • D Daniele_B
                  16 Oct 2017, 16:05

                  @kshegunov I'm testing a standard "hello world" program, but gdb doesn't hit breakpoints with any code...

                  K Offline
                  K Offline
                  kshegunov
                  Moderators
                  wrote on 16 Oct 2017, 16:12 last edited by kshegunov
                  #8

                  I don't know, nothing else comes to mind. Just for completeness if someone else has other ideas would you post your g++ and gdb version and your test program (I assume 3-4 lines long). Also could you test with a newer creator (e.g. 4.3.x or 4.4.x)?

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    Daniele_B
                    wrote on 16 Oct 2017, 20:04 last edited by
                    #9

                    gcc:

                    gcc version 6.4.0 20170820 (Debian 6.4.0-4)
                    

                    gdb:

                    GNU gdb 7.11.1
                    

                    Program code:

                    #include <iostream>
                    
                    using namespace std;
                    
                    int main()
                    {
                        cout << "Hello World!" << endl;
                        return 0;
                    }
                    
                    
                    1 Reply Last reply
                    0

                    8/9

                    16 Oct 2017, 16:12

                    • Login

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