Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ncassetta on March 25, 2016, 02:09:04 pm

Title: Trouble with TDM64-GCC and debugging
Post by: ncassetta on March 25, 2016, 02:09:04 pm
I installed separately first TDM64-GCC 5.1.0-2 (in its standard folder C:\TDM-GCC-64) and then CodeBlocks 16.1 in Windows 10. CodeBlocks detected correctly the compiler, but not gdb.
I tried to compile your "hello" project and all went OK. When I tried to debug, CodeBlocks said: "ERROR: you must specify a debugger program in the debugger's settings". In the settings the 'Executable path' field was empty and red coloured.
If I write "gdb.exe" in the field the debugger starts, but hangs on the first cout << "Hello world" line and I must use Ctrl Alt Canc to kill it.
I saw another GDB64/bin subfolder of TDM and tried with it but the result is the same. However, the "Executable path" box remains red whatever I write.
Is this a TDM problem? Is there a particular version of it I must install with CodeBlocks (I'd prefer to have a compiler folder separate from CodeBlocks one, as in your MingW download).
Title: Re: Trouble with TDM64-GCC and debugging
Post by: oBFusCATed on March 25, 2016, 08:51:53 pm
If I write "gdb.exe" in the field the debugger starts, but hangs on the first cout << "Hello world" line and I must use Ctrl Alt Canc to kill it.
What do you mean by hangs?
Does everything work correctly if you use command line gdb?

However, the "Executable path" box remains red whatever I write.
Have you tried with a full path to the debugger?
Title: Re: Trouble with TDM64-GCC and debugging
Post by: ncassetta on March 26, 2016, 02:05:19 pm
 Hangs means gdb entered the "cout << "Hello world!" line with the "Step into" button but never returned. Clicking the "Stop debugging" icon didn't stop it, and I found the gdp process in the Ctrl Alt Canc window. However also gdb from the command line had the same problem with the "step" command, giving me a lot of warnings, so I guessed it was a compiler problem.
I resolved removing TDM-64 and installing the 32 bit version, which is OK.
However thanks for your suggestion (with CodeBlocks I had almost forgotten command line  :)).