[Topic]How to use WinDbg tool debug QT APP, or other debug tools
-
wrote on 23 Mar 2011, 10:25 last edited by
I have two question:
- QtCreator(MingW) don't generate "pdb" format file(but nmake can)
- How use WinDbg debug QT App(Not found symbol file)
In fact, these two questions can be include one:
How to debug qt app if app running on Windows OS(not care other platforms)Whether QT or other third-party(open source) offer debug tools?
-
wrote on 23 Mar 2011, 11:23 last edited by
you can use gdb with mingw.
http://www.gnu.org/software/gdb/ -
wrote on 23 Mar 2011, 11:40 last edited by
- WinDBG can be used to debug apps that are created by MS tool chain
- for MinGW toolchain you need gdb
-
wrote on 23 Mar 2011, 13:44 last edited by
We support the windows debugger (CDB) in Qt Creator as well as gdb.
Which of these is used depends on which compiler you used to create the binaries with. As you already noted mingw does produce different debugging symbols form MSVC.
So if you want to use the windows debugger, then use the microsoft compilers. Use gdb when you want to use the mingw compiler.
-
wrote on 23 Mar 2011, 14:24 last edited by
[quote author="hakan" date="1300879403"]you can use gdb with mingw.
http://www.gnu.org/software/gdb/
[/quote]Thanks. If App running on Win, I prefer to windows debugger. cdb may do better than gdb on win os.
-
wrote on 23 Mar 2011, 14:31 last edited by
[quote author="Tobias Hunger" date="1300887887"]We support the windows debugger (CDB) in Qt Creator as well as gdb.
Which of these is used depends on which compiler you used to create the binaries with. As you already noted mingw does produce different debugging symbols form MSVC.
So if you want to use the windows debugger, then use the microsoft compilers. Use gdb when you want to use the mingw compiler.[/quote]
Yes. But the qt debugger worked very awful when I start debugging. Sometimes, the stack memory datas is wrong, and usually timeout and stop debugger.
-
wrote on 23 Mar 2011, 14:33 last edited by
If you want to use windows debugger on windows, you have to use windows tool chain, not mingw.
So you have to start from scratch, installing Qt for MSVS 200X (the one you have) and use that toolchain.
-
wrote on 23 Mar 2011, 14:46 last edited by
If App run crash, I can used WinDbg attached the process, and load symbol files to debug current crash process? What about cdb or gdb debug the crash app
-
wrote on 23 Mar 2011, 14:52 last edited by
cdb is equal to windbg in this case.
Both debug only apps buiold with Microsoft cl and toolchain
gdb can also attach to a process (afaik) but I'm not a gdb expert. -
wrote on 23 Mar 2011, 14:54 last edited by
[quote author="Gerolf" date="1300890836"]If you want to use windows debugger on windows, you have to use windows tool chain, not mingw.
So you have to start from scratch, installing Qt for MSVS 200X (the one you have) and use that toolchain.[/quote]
Since QT creator can compile, should offer the debugger solution on windows. When the app run crash, I usually use WinDbg attached the crash process, and load symbol files. It's very easy to resolve some diffcult bugs. And sometimes use dump file...
-
wrote on 23 Mar 2011, 14:56 last edited by
[quote author="Gerolf" date="1300891937"]cdb is equal to windbg in this case.
Both debug only apps buiold with Microsoft cl and toolchain
gdb can also attach to a process (afaik) but I'm not a gdb expert.[/quote]Oh, I download the gdb and debug my bad software. Thanks
-
wrote on 23 Mar 2011, 15:31 last edited by
I'm very depressed. QT Creator has "attach to running external application" option in Menu "Debug->StartDebugging", and I setup the dbg_x86.
But if the app crashed, I attach to the process, but no respose.
So I use another way: "Start application", and make the app crash, then capture the error and position. But the codes is assemble, and qtcreator suspend, no respose -
wrote on 23 Mar 2011, 16:32 last edited by
[quote author="yeaiping" date="1300892042"]Since QT creator can compile, should offer the debugger solution on windows. When the app run crash, I usually use WinDbg attached the crash process, and load symbol files. It's very easy to resolve some diffcult bugs. And sometimes use dump file...[/quote]
Good support for the windows visual studio toolchain debuggers (aka CDB) are in the works, so please stay tuned.
9/13