This example demonstrates a problem we have in Qt Creator ( Attaching to console processes fails, see http://bugreports.qt.nokia.com/browse/QTCREATORBUG-1020 ) Qt Creator uses a process stub to run the debuggee in the case of console processes. What we actually want is creating a suspended process and letting gdb attach to it. Unfortunately, the Windows kernel (Windows XP) runs amok when we attempt this. So instead the stub starts a debugged process, eats all the initial debug events, suspends the process and detaches from it before gdb is attached. This has been known to work in MinGw-setups based on gcc 3.4.X. Recent versions of gdb however do no longer break into the process. They print several "running" messages and hang. The example archive contains: - demoapp: A simple demo console app with a input loop terminated by 'q' - process_stub: A stripped version of the Qt Creator console stub that launches the demo process as described above and attaches gdb to it. - test.bat: A test script that launches it How to build ============ Prerequisites: - MinGw with gcc 4.4.X - gdb 7.X built for MinGw - There must be no sh.exe located in the search path (for mingw32-make to work correctly) Build: - Run mingw32-make in the directory gdb_test Run: - Check the gdb binary specified in test.bat - Run test.bat The demo application starts. In a 2nd console Window, gdb starts and attaches. Instead of breaking into the process, it prints several "running" messages and hangs. Example log of gdb 7.0.1 ======================== ~"GNU gdb (GDB) 7.0.1\n" ~"Copyright (C) 2009 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later \ n" ~"This is free software: you are free to change and redistribute it.\n" ~"There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\n " ~"and \"show warranty\" for details.\n" ~"This GDB was configured as \"i686-pc-mingw32\".\n" ~"For bug reporting instructions, please see:\n" ~".\n" ~"Attaching to process 4824\n" =thread-group-created,id="4824" =thread-created,id="1",group-id="4824" ~"[New Thread 4824.0x1568]\n" *running,thread-id="all" =thread-created,id="2",group-id="4824" ~"[New Thread 4824.0x4d4]\n" *running,thread-id="all"