Author Topic: Debugger fails (Win7 64, mingw 8.1)  (Read 639 times)

Offline nji

  • Multiple posting newcomer
  • *
  • Posts: 49
Debugger fails (Win7 64, mingw 8.1)
« 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?

Offline nji

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debugger fails (Win7 64, mingw 8.1)
« Reply #1 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
???

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12739
    • Travis build status
Re: Debugger fails (Win7 64, mingw 8.1)
« Reply #2 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...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2252
Re: Debugger fails (Win7 64, mingw 8.1)
« Reply #3 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".
« Last Edit: July 04, 2020, 08:42:36 pm by Pecan »

Offline nji

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debugger fails (Win7 64, mingw 8.1)
« Reply #4 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: [Select]
g++.exe -Wall -fexceptions -g  -c D:\Guido\develop\Mist\main.cpp -o obj\Debug\main.o("Mist" is the German word for "Junk".)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6957
    • My Best Post
Re: Debugger fails (Win7 64, mingw 8.1)
« Reply #5 on: July 05, 2020, 01:18:02 am »
You did check the link command for strip "-s" commands, correct?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline nji

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debugger fails (Win7 64, mingw 8.1)
« Reply #6 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).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12739
    • Travis build status
Re: Debugger fails (Win7 64, mingw 8.1)
« Reply #7 on: July 05, 2020, 12:49:28 pm »
The assert is fixed in trunk/master. Thanks for reporting.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2773
Re: Debugger fails (Win7 64, mingw 8.1)
« Reply #8 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...