Please nominate your Qt Champions for 2021!

Qt Creator - debug function - exit function

  • I use the debug mode of QT creator for a C program. I put breakpoints for all exit and "return 0" functions which are the only options to terminate the program. I run the code in the debug mode but the program is always terminating by itself without any error message. Moreover, it does not hit the breakpoints that I added. Is there anyway to see what line/function calls the exit function? or what was the last line that was executed in the program?

    Thank you.

  • welcome to devnet

    You need to give at least some details on the environment you are using (OS, Qt creator version, compiler, debugger, ...).
    Can you step into your source code at all?

  • Thank you

    Sorry that I forgot to write main details.

    I am using ubuntu 12.04 and installed Qt SDK (fulll name of the package is: Complete Qt Software Development Kit) by Ubuntu Software Center. Qt creator version is "Qt Creator 2.4.1 Based on Qt 4.8.0 (64 bit)". I use all the default settings in the Qt Creator, I just installed it couple hours ago (I needed to format my pc) but I have been using the Qt Creator before.

    Tools > Options > Build & Run > Tool Chains shows GCC (x86 64bit) and GCC (x86 32Bit). I use the debug option on the toolbar of the Qt Creator.
    Here is my .pro file
    TEMPLATE = app
    CONFIG += console
    CONFIG -= qt
    CONFIG += thread
    CONFIG += debug
    SOURCES += main.c

    I am able to step into the source code. The code works fine for 40 sec, then the program stops by itself without any warning/error signal and it does not stop on the breakpoints that I put for exit functions and return 0; of the main function.

    I wonder is there any way to see on the debug properties to see what line/function calls the exit function and what was the executed line on the code?

Log in to reply