Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Breakpoints are not getting hit, not working in Qt creator.

[SOLVED] Breakpoints are not getting hit, not working in Qt creator.

Scheduled Pinned Locked Moved General and Desktop
qtcreatordebugbreak point
5 Posts 3 Posters 11.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.
  • T Offline
    T Offline
    Tusharh
    wrote on 28 May 2015, 11:18 last edited by Tusharh
    #1

    Hi,
    I am working on application.The build is successful. On clicking debug button application launches but breakpoints don't get hit, breakpoints aren't working. I tried this scenario on 3 machines. 2 opensuse 13.1 machines & 1 Mac 10.10. Everywhere on debugging, application is launched but breakpoints aren't working.

    My Qt details:
    Qt creator 3.3.1
    Based on Qt 5.4.1 (GCC 4.6.1, 64 bit)
    Built on Feb 20 2015

    Machine details:
    Linux linux-s17i 3.11.6-4-desktop #1 SMP PREEMPT Wed Oct 30 18:04:56 UTC 2013 (e6d4a27) x86_64 x86_64 x86_64 GNU/Linux

    GNU gdb (GDB; openSUSE 13.1) 7.6.50.20130731-cvs

    1 Reply Last reply
    0
    • D Offline
      D Offline
      darkp03
      wrote on 28 May 2015, 11:54 last edited by
      #2

      This might be extremelly basic, but are you sure you are working on Debug, and not on Release?
      If you place breakpoints, and then click the Debug Button, while working on Release, the breakpoints wont work, and Qt wont give you any warning at all.

      T 1 Reply Last reply 28 May 2015, 12:02
      0
      • D darkp03
        28 May 2015, 11:54

        This might be extremelly basic, but are you sure you are working on Debug, and not on Release?
        If you place breakpoints, and then click the Debug Button, while working on Release, the breakpoints wont work, and Qt wont give you any warning at all.

        T Offline
        T Offline
        Tusharh
        wrote on 28 May 2015, 12:02 last edited by Tusharh
        #3

        @darkp03 Later I installed Netbeans latest version & it built successfully & I was also able to debug also!! . But Netbeans can't recognize QString & shows it as some structure which is unreadable :(

        I uninstalled & reinstalled gdb, but still in debug mode, Qt creator breakpoints won't hit. I checked all cmakelists.txt & cmake files, everything is correct. No success still.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Tusharh
          wrote on 28 May 2015, 12:28 last edited by Tusharh
          #4

          SET(CMAKE_BUILD_TYPE Debug) added this line to CMakeLists.txt and now I am able to debug now. Breakpoints are getting hit properly :)

          or you can simply give cmake command cmake -DCMAKE_BUILD_TYPE=Debug

          But, how were Netbeans' breakpoint getting hit without the above command still bothers me. Anyways thanks.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mchinand
            wrote on 28 May 2015, 14:19 last edited by
            #5

            If you have code that benefits significantly from compiler optimizations, you might want to try to compile in 'release with debug info' instead:

            cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo
            

            As @darkp03 mentioned, make sure you are pressing QtCreator's 'debug button' (or shortcut key F5) and not the 'run' button.

            1 Reply Last reply
            0

            1/5

            28 May 2015, 11:18

            • Login

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