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. How to trouble shoot qt application on commad line using GDB
Forum Updated to NodeBB v4.3 + New Features

How to trouble shoot qt application on commad line using GDB

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 123 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.
  • R Offline
    R Offline
    Rajashekara V
    wrote on 29 Jan 2024, 10:42 last edited by
    #1

    gdb programName
    When i single step the application, control comes and stop it at a.exec().
    After a.exec, i'm not able to run any GDB command's as GDB stopped at a.exec().

    I don't want to use Qt creator.

    J 1 Reply Last reply 29 Jan 2024, 11:33
    0
    • R Rajashekara V
      29 Jan 2024, 10:42

      gdb programName
      When i single step the application, control comes and stop it at a.exec().
      After a.exec, i'm not able to run any GDB command's as GDB stopped at a.exec().

      I don't want to use Qt creator.

      J Online
      J Online
      JonB
      wrote on 29 Jan 2024, 11:33 last edited by JonB
      #2

      @Rajashekara-V
      Yes, what else do you expect? It is not "stopped" at a.exec(), rather it is running inside whatever that calls. And will continue to do so until you exit the Qt program. In the same way as it would if it were not a Qt program.

      You have two choices if you want to then "break into" the gdb debugger:

      • Put breakpoint(s) wherever. When they are hit execution should stop, you return to the gdb command prompt, and do whatever you like. continue, I think, is the command to issue when you want it to carry on running from where it got to. (Note: if you expect to step into a.exec() --- not a good idea --- you would need (a) Qt itself compiled for debug and (b) gdb to see Qt's source files.)

      • Press the keyboard interrupt character at the gdb command prompt in the terminal, e.g. Ctrl+C. That should break into gdb. You might have to set something in gdb to allow it, and to allow it to continue without raising the interrupt signal when you are done, but again should be same as for non-Qt program. Be aware you will break somewhere deep inside the Qt event loop.

      1 Reply Last reply
      2

      1/2

      29 Jan 2024, 10:42

      • Login

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