Author Topic: Is there a way of automatically configuring debugger on initial install?  (Read 18553 times)

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
I have looked and cannot find any auto detect or code that tries to do any configuration of a debugger on initial install so that the end user does not have to configure the debugger manually.

If I have missed something can you please point me to where I have missed it. I also if this has been discussed before can someone please let me know the thread link or what to search for in the forum so I can see what was attempted and why it failed or in the more likely case was rejected.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
There is no such code, nor there are previous attempts to do it after the switch to the debugger config style.
Before that the debugger exe setting was part of the compiler settings.

Not sure it is worth the complications at the moment.
(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 AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
oBFusCATed, thanks for the response.  I have a working P.O.C. that optionally adds the debugger configs and links the compiler.

Over the next few days I am now going to test that the following compilers I have on my Windows setup work with all of the patches I have been working on and fix any bugs I come across:
1) GCC Cygwin
2) GCC MSYS2 - mingw32
3) GCC MSYS2 - mingw64
4) GCC TDM-32
5) GCC TDM-64
6) GCC mingw-w64
7) GCC mingw    (mingw32)
8) LLVM Clang MSYS2 - mingw64


Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
I have the code changes done, tested and ready to submit to resolve ticket 114 once the following has been done:
1) Ticket 374 patch lands in the truck.
2) Cygwin code changes lands in the trunk
3) Submit patch for ticket 1117 once 1 & 2 are done
4) Submit patch for ticket 1111 once 3 lands in the trunk

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
1 is highly unlikely to happen. For me TDM is dead for example (it cannot compile C::B in its last version).
Also I'm not sure we want to have 10 different but kind of the same compilers in the list.
I suppose the code should do a copy when it auto-detects multiple compilers of the same kind, but then it gets really complex about the order and naming.

I see a patch about 3, isn't this the latest version?
I don't see why 4 is a dependency on this one.
(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 AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Just because the TDM 10.3 does not build CB should not be a criteria for not including it as allot of the supported compilers also do not compile CB.

I agree with the compilers being very very similar, but they each have different search directories and there are a few different debugger executables used. Having individual sets of files for each compiler allows you to select between them instead of having to change the configuration every time you want to swap between them. The code is all ready complex enough and adding extra code to "try" and auto detect multiple compilers in Windows and then copy the config and update it due to the different executables names used for some of the compilers would ne a nightmare, but adding the compiler & options XML file sets is allot easier and later when the compilers die they can be dropped allot easier.

As per my last post in 1117 the patch had a small bug in which I found when making changes for ticket 1111.

I have tested 1111 on a branch that includes the previous changes in order to fully test the changes and ensure that all of the changes work together to ensure that an end user doing a first time install can get a working compiler allot easier than with the current code.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Just because the TDM 10.3 does not build CB should not be a criteria for not including it as allot of the supported compilers also do not compile CB.
"does not build CB" is more like "it is broken and produces failing code". No idea why, but there are reports that CB is crashing when built with this compiler. I don't want to promote broken compilers. We've used TDM for a long time, but currently it is not well supported by TDragon and so we have to move on.
(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 AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
I have been able to build CB with TDM-64 10.3.0 and use the CB produced to compiler a simple app and debug it.

Can you point me at the posts about "it is broken and produces failing code"?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Nope, search the forum, I'm a linux user mainly and for windows I'm just a spectator...
« Last Edit: July 18, 2021, 09:15:51 pm by oBFusCATed »
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
I have been able to build CB with TDM-64 10.3.0 and use the CB produced to compiler a simple app and debug it.

Can you point me at the posts about "it is broken and produces failing code"?

You may wish to say where you got the TDM-64 10.3.0 from?

Because I have no idea if you mean the real original website or the second website that was NOT the same person or some new third website.

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

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
@oBFusCATed There are 6 forum posts after 2010 that reference TDM I have listed below. I also looked at the tickets and there is noting about TDM  "it is broken and produces failing code" that I could find.

2019: Topic: Error getting 32 bits aplication with CB, TDM and wxWidgets 
2018: gfortran TDM 5.1 problem
2017: Debugging with TDM GCC 32bit + CodeBlocks- can't find member variables
2017: multilib mingw-w64 TDM compiler
2015: TDM mingw 5.1 breaks XMLResourceHandler?
2012: problems with 32-bit executables in TDM mingw64 installation

In the 2015 post @stahta01 posted that -o3 often results in bad code. This is a GCC issue and not a specific TDM issue.
In the 2018 post there was a GCC bug report is referenced. Yet another GCC issue that is not specific TDM.

As such I cannot find any references to justify not including TDM as the two issues are GCC issues that would affect all of the compilers based on affected GCC source code.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
@stahta01

Either of following sites.
https://jmeubank.github.io/tdm-gcc/download/
https://sourceforge.net/projects/tdm-gcc/files/v10.3.0-tdm64-1/

The https://sourceforge.net/projects/tdm-gcc/ page has the following:
TDM-GCC is now hosted on Github at https://jmeubank.github.io/tdm-gcc/.

Wikipedia TDM link to the two sites above on their TDM page:
https://en.wikipedia.org/wiki/TDM-GCC

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
@oBFusCATed There are 6 forum posts after 2010 that reference TDM I have listed below. I also looked at the tickets and there is noting about TDM  "it is broken and produces failing code" that I could find.
https://forums.codeblocks.org/index.php/topic,23642.0.html

(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 AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Try the link as it does not work for me.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Works fine and it leads to "TDM-Gcc is discontinued" where TDM failures are discussed. I've not linked a particular post.
(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 AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
The link only works when I am logged in, otherwise it redirects me to https://forums.codeblocks.org/index.php

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Works fine in a private firefox window, too.
(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 nenin

  • Almost regular
  • **
  • Posts: 201
Over the next few days I am now going to test that the following compilers I have on my Windows setup work with all of the patches I have been working on and fix any bugs I come across:
I propose to add to list https://winlibs.com/ - looks like this site offers most fresh mingw-w64 + gcc out of msys2.
« Last Edit: July 29, 2021, 09:41:57 am by nenin »

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Quote
I propose to add to list https://winlibs.com/ - looks like this site offers most fresh mingw-w64 + gcc out of msys2.

This site is more for bleeding edge GCC compiler versions that you install over the top of an existing setup. If this is done then the existing setup and new GCC from the site will be supported via the patch included in ticket 374 once it lands in the trunk and a CB is released with the changes in it assuming it ever makes it into the trunk.


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
https://winlibs.com/, if I remember correctly, this compiler suite supply GDB, but the GDB is not python enabled.

So, I finally use this one: https://github.com/Guyutongxue/mingw-release

I have already post the reasons here: an annoying gcc bug which cause bad debugging experience is fixed in gcc trunk

EDIT: MinGW with GCC 11.1.0 works OK, and 11.2 version has some build issue, so please use 11.1 unless 11.2's issue is fixed.
« Last Edit: August 01, 2021, 04:43:22 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nenin

  • Almost regular
  • **
  • Posts: 201
https://winlibs.com/, if I remember correctly, this compiler suite supply GDB, but the GDB is not python enabled.
Yes, at that moment there is no python in winlibs GDB. Stand alone "pythonified" GDB can be found here: https://github.com/ssbssa/gdb/


Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #21 on: August 01, 2021, 03:06:34 am »
Have either @ollydbg or @nenin successfully built wxwidget 3.1.5 with either of the GCC 11.2 compilers?

I tried last night to build wxWidget 3.1.5 with both GCC 11.2.0 compilers and they both failed with completely different issues on my setup, one hung on 'ar' and another had multiple definitions when it looked like it was near the end, but unfortunately the scroll back buffer was not large enough for me to scroll back to see what command the build was running that displayed the multiple defninitions. I also tried the wxWidget truck (be aware you need to g"git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets" due to linked sub projects), but it also failed to build.

BTW: I had major issues until I told my AV to bugger off with the install directory after I scanned the install files....grrrr.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #22 on: August 01, 2021, 04:41:14 am »
Have either @ollydbg or @nenin successfully built wxwidget 3.1.5 with either of the GCC 11.2 compilers?

I tried last night to build wxWidget 3.1.5 with both GCC 11.2.0 compilers and they both failed with completely different issues on my setup, one hung on 'ar' and another had multiple definitions when it looked like it was near the end, but unfortunately the scroll back buffer was not large enough for me to scroll back to see what command the build was running that displayed the multiple defninitions. I also tried the wxWidget truck (be aware you need to g"git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets" due to linked sub projects), but it also failed to build.

BTW: I had major issues until I told my AV to bugger off with the install directory after I scanned the install files....grrrr.

Hi, for gytx's GCC 11.2, I also failed to build wxWidgets 3.1.5, some build issues are reported and identified here:

https://github.com/Guyutongxue/mingw-release/issues?q=

So, please use gytx's GCC 11.1. (see here: MinGW with GCC 11.1.0) This works OK for several months in my PC.

I haven't build the wxWidgets' trunk yet.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nenin

  • Almost regular
  • **
  • Posts: 201
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #23 on: August 01, 2021, 07:42:36 am »
Have either @ollydbg or @nenin successfully built wxwidget 3.1.5 with either of the GCC 11.2 compilers?
I have 32b compiler installed.  I can try.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #24 on: August 01, 2021, 08:08:32 am »
@ollydbg, I spotted the issue and also spotted the wxwidget trunk included GCC 11 build fixes so I thought I would try, but it failed.

I did as suggested and tried the gytx's GCC 11.1.0 and it worked successfully with regards to building wxwidget 3.1.5 and CB with no issues The resulting CB runs okay in my 10 minutes testing I did.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #25 on: August 01, 2021, 08:46:44 am »
@ollydbg, I spotted the issue and also spotted the wxwidget trunk included GCC 11 build fixes so I thought I would try, but it failed.

I did as suggested and tried the gytx's GCC 11.1.0 and it worked successfully with regards to building wxwidget 3.1.5 and CB with no issues The resulting CB runs okay in my 10 minutes testing I did.

Good to hear. I'm using gytx's GCC 11.1.0 for several months, and I don't see issues of the result C::B. :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nenin

  • Almost regular
  • **
  • Posts: 201
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #26 on: August 01, 2021, 09:03:33 am »
@ollydbg, I spotted the issue and also spotted the wxwidget trunk included GCC 11 build fixes so I thought I would try, but it failed.

I did as suggested and tried the gytx's GCC 11.1.0 and it worked successfully with regards to building wxwidget 3.1.5 and CB with no issues The resulting CB runs okay in my 10 minutes testing I did.
I just made 64b  mono build with winlibs 11.2 without errors with options: "-O2 -DNDEBUG -march=nocona  -s -msse4"

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #27 on: August 02, 2021, 04:29:56 am »
Some good news about gcc 11.2, MinGW with GCC 11.2.0 (revision 1) this fixed the build issue, and I can build wx 3.1.5 and code::blocks now without any issue.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #28 on: August 02, 2021, 08:46:16 am »
@ollydbg thanks for the info and link. I have also been able to build wxwidget and CB without any issues.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Is there a way of automatically configuring debugger on initial install?
« Reply #29 on: February 10, 2022, 02:10:11 pm »
https://winlibs.com/, if I remember correctly, this compiler suite supply GDB, but the GDB is not python enabled.

So, I finally use this one: https://github.com/Guyutongxue/mingw-release

I have already post the reasons here: an annoying gcc bug which cause bad debugging experience is fixed in gcc trunk

EDIT: MinGW with GCC 11.1.0 works OK, and 11.2 version has some build issue, so please use 11.1 unless 11.2's issue is fixed.

Hi, it looks like winlibs has gdb with python support. See:

Releases brechtsanders/winlibs_mingw

issue: the selected build of GDB does not support Python scripting. it cannot be used in qt creator.  Issue 2 brechtsanders/winlibs_mingw
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.