2

I'm looking for advice on QtCreator debugging. My OS is Ubuntu 18.04 64bit and QtCreator 4.12.4. Qt version 5.12.4. My issue is that when I run my code in debug mode, the debugger steps into and breaks inside Qt source library code. My question is how do I prevent stopping at breakpoints within Qt source library code because I have no interest in Qt source outside of my linking to the library. I just want to be able to set breakpoints within my own code but QtCreator debug breaks within Qt library source and this is very distracting, making the debugger unusable. Thanks in advance for your advice! Phil

  • For the most developers it is harder to step in Qt source code as there no debug symbols provided. People should first enable debugging Qt source code explicitly. And there breakpoints in Qt code already set? Also, strange. I would just don't do Step In (in Qt functions) which is F11 assignment in standard Qt Creator. Mind you have Shift-F11 to go up. And just do F10 over the Qt call and you will never be tracing the library itself. Or was it some crash situation inside Qt code? Then the reason must be up call stack in your code to fix. – Alexander V Aug 04 '20 at 22:47
  • Thanks Alexander V for responding. It turns out that I have the opposite problem, namely I don't want to step into Qt code and apparently I am. This is rendering the debugger useless since I apparently keep hitting breakpoints in the Qt code. My application works fine when not debugging. Thanks, Phil – montanaviking Aug 05 '20 at 00:00
  • And the debugger steps into Qt code even though I use F5 or F10. Thanks – montanaviking Aug 05 '20 at 00:01
  • The debugger keeps stopping at line 384 in qfactoryloader.cpp when hitting F10 in: int main(int argc, char *argv[]) { QApplication app(argc,argv); at QApplication app.... – montanaviking Aug 05 '20 at 00:03
  • You should start the debugging with F5 unless you want to go through the main() from start. Put a breakpoint in your code by locating it / F9 and then do F5 so it runs until it hits the breakpoint. Normally that works. Except if you have a problem with Qt code right away and maybe it wants to show you. You said you already have breakpoints in Qt code? Try to erase all breakpoints first then, – Alexander V Aug 05 '20 at 00:20
  • It appears that I found my answer. It looks like I had a bunch of breakpoints set that I didn't want. I told QCreator to remove all breakpoints then put in the ones I wanted and now the behavior is as expected. Thanks again! Phil – montanaviking Aug 05 '20 at 01:31
  • Does this answer your question? [How to avoid entering library's source files while debugging in Qt Creator with gdb?](https://stackoverflow.com/questions/1448426/how-to-avoid-entering-librarys-source-files-while-debugging-in-qt-creator-with) – Fred Aug 27 '21 at 13:32

0 Answers0