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

  • 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)

    Feature request added to Qt Creator issue tracker:

  • Moderators

    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": if you like.

  • 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?

  • Feature request added to Qt Creator issue tracker:

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

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.