Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: nji on July 04, 2020, 12:10:43 pm

Title: Debugger fails (Win7 64, mingw 8.1)
Post by: nji on July 04, 2020, 12:10:43 pm
I recently updated to CB 20.0.3 and have problems debugging:

When I build a simple console application and let it run
everything is OK - Hello world.

But when starting the debugger nothing happens.
A breakpoint is never reached.
If I stop the debugger, it doesn't react.
When closing CB the message appears:
"Project close while debugging".
After confirming, the task manager shows
gdb.exe, gdborig.exe and conhost.exe are still running.
Have to kill them.
What's going wrong here?
Title: Re: Debugger fails (Win7 64, mingw 8.1)
Post by: nji on July 04, 2020, 01:30:59 pm
Is there a connection to this?
http://forums.codeblocks.org/index.php/topic,23910.msg163121.html#msg163121

Although I don't understand what is meant there.

Where is the wrong version?
It says 8.1
???
Title: Re: Debugger fails (Win7 64, mingw 8.1)
Post by: oBFusCATed on July 04, 2020, 07:36:58 pm
As far as I know the mingw64 release we're using has a broken debugger. You'll have to find something which works. I cannot help much, because I don't use windows...
Title: Re: Debugger fails (Win7 64, mingw 8.1)
Post by: Pecan on July 04, 2020, 08:37:39 pm
I recently updated to CB 20.0.3 and have problems debugging:

When I build a simple console application and let it run
everything is OK - Hello world.

But when starting the debugger nothing happens.
A breakpoint is never reached.
If I stop the debugger, it doesn't react.
When closing CB the message appears:
"Project close while debugging".
After confirming, the task manager shows
gdb.exe, gdborig.exe and conhost.exe are still running.
Have to kill them.
What's going wrong here?

This happens to me when:
1. I forget to turn on -g when compiling the project.
2. I have a request for input before any breakpoint.
3. gdb 8.1 with mingw seems to work ok in windows except for crashes when using "step out".
Title: Re: Debugger fails (Win7 64, mingw 8.1)
Post by: nji on July 04, 2020, 09:33:14 pm
As far as I know the mingw64 release we're using has a broken debugger. You'll have to find something which works. I cannot help much, because I don't use windows...

I also doubt mingw-64 will be the cause.

I downloaded x86_64-posix-seh from MinGW-W64 GCC-8.1.0.
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/

Entered it as toolchain and debugger at CB (BTW sys.path.insert had a wrong path in it...)
And had exactly the same effect.
Also there is no hint on a bug like this for gdb.

Second I installed CodeLite (guess why!)
and used the mingw from above.
Everything and the debugger worked PERFECTLY.

So it seems to be an error of Code::Blocks again.

I wonder why (after more than a year) I'm the first
to run into it.

Concerning option -g:
The command line is
Code
g++.exe -Wall -fexceptions -g  -c D:\Guido\develop\Mist\main.cpp -o obj\Debug\main.o
("Mist" is the German word for "Junk".)
Title: Re: Debugger fails (Win7 64, mingw 8.1)
Post by: stahta01 on July 05, 2020, 01:18:02 am
You did check the link command for strip "-s" commands, correct?

Tim S.
Title: Re: Debugger fails (Win7 64, mingw 8.1)
Post by: nji on July 05, 2020, 10:29:24 am
(No, there is no "-s" when linking, should it?)

One step further:

Someone was so kind to try for me.
He had mingw 8.1 installed but not CB.
He installed CB and the debugger worked fine!

So I thought it must be something with MY CB config.
Although I surely did not fiddle around with that
when installing CB 20.03 (bundled with mingw).

Nevertheless I did
Settings / Debugger / Reset defaults.
When I click on it, always a message pops up
(see attachment).
But after that...tah-tah...

Debugging works!

Maybe it's not worth investigating what has happened.
But maybe that error message is of some interest (although I don't mind).
Title: Re: Debugger fails (Win7 64, mingw 8.1)
Post by: oBFusCATed on July 05, 2020, 12:49:28 pm
The assert is fixed in trunk/master. Thanks for reporting.
Title: Re: Debugger fails (Win7 64, mingw 8.1)
Post by: BlueHazzard on July 06, 2020, 05:42:53 pm
Is there a connection to this?
http://forums.codeblocks.org/index.php/topic,23910.msg163121.html#msg163121

Although I don't understand what is meant there.

Where is the wrong version?
It says 8.1
???

Probably not. In this case gdb crashed. GDB Version 8.1.0 is known for crashing in some cases. Has nothing to do with codeblocks.

Debugging works!
Good to hear. The next time you have a debugging problem, please enable full debug logging in
Settings->Debugger->Genera->Full log

and then post the content of the "Debug Log" tab here in the forum. And please use code tags for the log (The # symbol in the editor) so we can help you better...