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. Qt Creator only stopping on some breakpoints
Forum Updated to NodeBB v4.3 + New Features

Qt Creator only stopping on some breakpoints

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 5 Posters 3.9k Views 5 Watching
  • 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.
  • kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by
    #5

    Two things to check:

    1. There aren't disabled breakpoints that you think are active.
    2. There aren't invalid breakpoints - such that can't be mapped by the debugger. When the debugger starts regular breakpoints will be just a red disk, while invalid ones will be red disk with a tiny hourglass.

    Also give an example at what kind of lines the debugger doesn't want to stop.

    Read and abide by the Qt Code of Conduct

    1 Reply Last reply
    0
    • U Offline
      U Offline
      udirub
      wrote on last edited by
      #6

      I checked and when I start the debugger the breakpoints in my class do have a tiny hourglass while the breakpoints in MainWindow don't have the hourglass.
      I pretty much tried putting a breakpoint everywhere in my class: instantiations, ifs, function calls, nothing works..
      Here is my code:

      #include <QObject>
      #include <QUuid>
      #include <QMap>
      #include "MetaItem.h"
      #include "Template.h"
      
      class Environment
      {
      public:
          static void initInstance();
          static Environment* getInstance();
      
          Environment();
      
      private:
          static Environment* _instance;
      
          QMap<QUuid, MetaItem>* _idToItem;
          QMap<Template, MetaItem>* _templateToitem;
      
          Template _templateTemplate;
      
          bool _loadedBaseTemplates;
      
          void loadJson();
      
      };
      
      
      void Environment::initInstance()
      {
          _instance = new Environment();
      }
      
      Environment* Environment::getInstance()
      {
          return _instance;
      }
      
      Environment::Environment()
      {
          _idToItem = new QMap<QUuid, MetaItem>();
          _templateToitem = new QMap<Template, MetaItem>();
      
          _loadedBaseTemplates = false;
      
          loadJson();
      }
      
      void Environment::loadJson()
      {
          qWarning(QDir::currentPath().toLatin1());
          QFile file(":/Files/Environment.json");
      
          if ( ! file.open(QIODevice::ReadOnly))
          {
              qWarning("Error loading Environment.json");
              return;
          }
      
          QByteArray fileData = file.readAll();
      
          QJsonDocument jsonDocument = QJsonDocument::fromJson(fileData);
      
          QJsonObject root = jsonDocument.object();
      }
      
      kshegunovK 1 Reply Last reply
      0
      • U udirub

        I checked and when I start the debugger the breakpoints in my class do have a tiny hourglass while the breakpoints in MainWindow don't have the hourglass.
        I pretty much tried putting a breakpoint everywhere in my class: instantiations, ifs, function calls, nothing works..
        Here is my code:

        #include <QObject>
        #include <QUuid>
        #include <QMap>
        #include "MetaItem.h"
        #include "Template.h"
        
        class Environment
        {
        public:
            static void initInstance();
            static Environment* getInstance();
        
            Environment();
        
        private:
            static Environment* _instance;
        
            QMap<QUuid, MetaItem>* _idToItem;
            QMap<Template, MetaItem>* _templateToitem;
        
            Template _templateTemplate;
        
            bool _loadedBaseTemplates;
        
            void loadJson();
        
        };
        
        
        void Environment::initInstance()
        {
            _instance = new Environment();
        }
        
        Environment* Environment::getInstance()
        {
            return _instance;
        }
        
        Environment::Environment()
        {
            _idToItem = new QMap<QUuid, MetaItem>();
            _templateToitem = new QMap<Template, MetaItem>();
        
            _loadedBaseTemplates = false;
        
            loadJson();
        }
        
        void Environment::loadJson()
        {
            qWarning(QDir::currentPath().toLatin1());
            QFile file(":/Files/Environment.json");
        
            if ( ! file.open(QIODevice::ReadOnly))
            {
                qWarning("Error loading Environment.json");
                return;
            }
        
            QByteArray fileData = file.readAll();
        
            QJsonDocument jsonDocument = QJsonDocument::fromJson(fileData);
        
            QJsonObject root = jsonDocument.object();
        }
        
        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by kshegunov
        #7

        @udirub said in Qt Creator only stopping on some breakpoints:

        I checked and when I start the debugger the breakpoints in my class do have a tiny hourglass while the breakpoints in MainWindow don't have the hourglass.

        This means the debugger is unable to resolve the breakpoints in your class, so it won't stop at them. Are both classes in the same project, or is one of them in a library? Perhaps you can make sure you're in debug mode? Make sure your class' header and source are listed in your project file as well.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        0
        • U Offline
          U Offline
          udirub
          wrote on last edited by
          #8

          All classes are in the same project and in the same folder. I created my class through Qt Creator as an empty class. I haven't added any libraries.
          I know I'm in debug mode because it does stop on the breakpoints in MainWindow.
          Both header and source are listed in my project under Headers and Sources respectively.

          kshegunovK 1 Reply Last reply
          0
          • U udirub

            All classes are in the same project and in the same folder. I created my class through Qt Creator as an empty class. I haven't added any libraries.
            I know I'm in debug mode because it does stop on the breakpoints in MainWindow.
            Both header and source are listed in my project under Headers and Sources respectively.

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #9

            Okay, then I have no clue why the debugger won't resolve the breakpoints, sorry.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #10

              Hi,

              To add to my fellow, you should also add which version of Qt Creator you are using as well as OS X and Xcode version.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              mrjjM 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                To add to my fellow, you should also add which version of Qt Creator you are using as well as OS X and Xcode version.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #11

                @SGaist
                "I'm running Qt Creator 4.1.0 based on Qt 5.7.0 (Clang 7.0 (Apple)) 64 bit on MacOSX 10.11.6."

                Xcode version missing ?

                1 Reply Last reply
                0
                • U Offline
                  U Offline
                  udirub
                  wrote on last edited by
                  #12

                  OK, I created a new class and copied everything into it and now it works :)
                  I have no idea what the problem was...
                  Thanks for you help!

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #13

                    @mrjj, Yep, I missed that line but indeed the Xcode version was missing.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • K Offline
                      K Offline
                      kimonsatan
                      wrote on last edited by
                      #14

                      Hi,

                      I have the same issue OSX El Capitan , QT Creator 4.1 , Apple LLVM version 7.3.0 (clang-703.0.29), lldb-350.0.21.3

                      I can't seem to create a breakpoint without an hour glass on it. I'm doing this with a plain C++ project , hello world.

                      Sometimes the breakpoints work sometimes not. Is there something I'm missing re:compiler flags, environment variables ? The .dsym looks sizeable enough and lldb works fine in terminal.

                      Is it worth installing gdb and using that instead ?

                      cheers

                      1 Reply Last reply
                      0

                      • Login

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