Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. How to "step into" virtual slot from signal emit?
Qt 6.11 is out! See what's new in the release blog

How to "step into" virtual slot from signal emit?

Scheduled Pinned Locked Moved C++ Gurus
5 Posts 3 Posters 5.3k Views 1 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.
  • j1eloJ Offline
    j1eloJ Offline
    j1elo
    wrote on last edited by
    #1

    Hello all;

    I've always been a huge fan of debugging but there is this little inconvenience that bugs me (pun intended). I'm sure something like this must have been already discussed in the forum but I couldn't find it with any of the terms I could think of for searching.

    The problem is, when using "step by step" debugging, specifically "Step Over" and "Step Into", reaching a "emit" sentence and wanting to follow its execution (assuming a direct connection) means having to go through the moc file of the sender, then the big QMetaObject::activate method until the callFunction() line, then the moc file of the receiver, and then (at last!) the slot which most of the time was the desired "next step" in the debugging process.

    This is not a huge problem, but it is a huge inconvenience. Does Qt Creator have any kind of support to debug slot activation in a more "useful" way?

    Of course I can overcome this by manually keeping track of all the connections previously done between objects, but I guess it's obvious that this is not viable at all when we speak about a big or huge code base which makes use of virtual slots and complex logic for connection-disconnection of objects. Nor spreading QSignalSpy instances all around, which is not feasible given the size of the code (and the fact that those are not actually need for the logic of the program in use).

    (using Qt 4.8.4 and Qt Creator 3.0.0 under Linux)

    EDIT
    Feature request added to Qt Creator issue tracker:
    https://bugreports.qt-project.org/browse/QTCREATORBUG-11330

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      no thats not possible. Since how should the debugger know when the abstract layer (moc) starts and when it ends. For the debugger everything is ordinary symbols created from C++.

      The only way i see would be to implement such feature in QtCreator. You can file a "feature request":https://bugreports.qt-project.org/browse/QTCREATORBUG if you like.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • j1eloJ Offline
        j1eloJ Offline
        j1elo
        wrote on last edited by
        #3

        Well of course it can't be a functionality given by GDB: it doesn't understand the semantics of any abstraction used.

        This is something that would exist in the "user" side of things, and since we are talking Qt here, it seems clear that this is a feature to be offered by Qt Creator itself.

        What strikes me is that this doesn't actually exist, after all the years that Qt has existed. Maybe I'm doing something wrong, but I assumed hundreds of developers would hit this problem in their everyday debugging sessions, and that some tool or extension would already cover it.

        Maybe it is a feature offered only under commercial licenses?

        1 Reply Last reply
        0
        • j1eloJ Offline
          j1eloJ Offline
          j1elo
          wrote on last edited by
          #4

          Feature request added to Qt Creator issue tracker:
          https://bugreports.qt-project.org/browse/QTCREATORBUG-11330

          1 Reply Last reply
          0
          • A Offline
            A Offline
            apoenitz
            wrote on last edited by
            #5

            Check out Tools->Options->Debugger->GDB, "Skip known frames when stepping".

            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