Author Topic: gdb of better compiler not working  (Read 2164 times)

Offline mckl

  • Single posting newcomer
  • *
  • Posts: 7
gdb of better compiler not working
« on: April 18, 2024, 11:03:38 am »
Ok so i ve set up new mingw64 compiler 13.2 so c++ 20 is working. But debugger is not functioning completely. I ve tried to put older version 8.1 back so it fixed it. But how to adjust debugger for newer compiler. It does not read breakpoints at all and I am getting:

[debug]terminate called after throwing an instance of 'std::system_error'
[debug]  what():  terminate called recursively
[debug]Invalid argument
[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints
Debugger finished with status 1


Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1591
Re: gdb of better compiler not working
« Reply #1 on: April 18, 2024, 11:17:24 am »
Are you using a recent nightly or the 20.03 release?

Offline mckl

  • Single posting newcomer
  • *
  • Posts: 7
Re: gdb of better compiler not working
« Reply #2 on: April 18, 2024, 11:20:26 am »
20.03

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1591
Re: gdb of better compiler not working
« Reply #3 on: April 18, 2024, 12:49:02 pm »
Recent GDB introduced some changes in the output so parsing failed. This was fixed in r13162 a year ago, try the last nightly.

Offline mckl

  • Single posting newcomer
  • *
  • Posts: 7
Re: gdb of better compiler not working
« Reply #4 on: April 18, 2024, 02:28:25 pm »
Yeah I just installed Last nightly with dll flies and put them into folder and still the same issue.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1591
Re: gdb of better compiler not working
« Reply #5 on: April 18, 2024, 03:33:59 pm »
Activate "Full debug log" in Settings->Debugger->Common and attach the log here.

Offline mckl

  • Single posting newcomer
  • *
  • Posts: 7
Re: gdb of better compiler not working
« Reply #6 on: April 19, 2024, 12:05:49 am »
Yeah it is already in full

Offline mckl

  • Single posting newcomer
  • *
  • Posts: 7
Re: gdb of better compiler not working
« Reply #7 on: April 19, 2024, 02:08:51 am »
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\mstar\Desktop\CPP_AIO4\BookIV\Chapter02\BuggyProgram\
Adding source dir: C:\Users\mstar\Desktop\CPP_AIO4\BookIV\Chapter02\BuggyProgram\
Adding file: C:\Users\mstar\Desktop\CPP_AIO4\BookIV\Chapter02\BuggyProgram\bin\Debug\BuggyProgram.exe
Changing directory to: C:/Users/mstar/Desktop/CPP_AIO4/BookIV/Chapter02/BuggyProgram/.
Set variable: PATH=.;C:\mingw64\bin;C:\mingw64;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Program Files\dotnet;C:\Users\mstar\AppData\Local\Programs\Python\Python38\Scripts;C:\Users\mstar\AppData\Local\Programs\Python\Python38;C:\Users\mstar\AppData\Local\Microsoft\WindowsApps;\;C:\Program Files\JetBrains\PyCharm Community Edition 2020.3\bin

[debug]Command-line: C:\mingw64\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/mstar/Desktop/CPP_AIO4/BookIV/Chapter02/BuggyProgram/bin/Debug/BuggyProgram.exe
[debug]Working dir : C:\Users\mstar\Desktop\CPP_AIO4\BookIV\Chapter02\BuggyProgram

Starting debugger: C:\mingw64\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/mstar/Desktop/CPP_AIO4/BookIV/Chapter02/BuggyProgram/bin/Debug/BuggyProgram.exe
done

[debug]terminate called after throwing an instance of 'std::system_error'
[debug]terminate called recursively
[debug]  what():  Invalid argument
[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints
Debugger finished with status 1

Offline mckl

  • Single posting newcomer
  • *
  • Posts: 7
Re: gdb of better compiler not working
« Reply #8 on: April 19, 2024, 07:16:26 am »
Never mind I ve figured it out turns out these nightly versions do not support 13.2 yet. So I have switched to 13.1 and now it works.

Offline nenin

  • Almost regular
  • **
  • Posts: 227
Re: gdb of better compiler not working
« Reply #9 on: April 19, 2024, 07:41:48 am »
Recent GDB introduced some changes in the output so parsing failed. This was fixed in r13162 a year ago, try the last nightly.
Here is potential other issue: The 01 April 2024 build (13496) is actually built with gcc 13.2, all its dlls- with gcc 13.1. At my experience  mixing of the c++ libraries is a lottery.

Offline nenin

  • Almost regular
  • **
  • Posts: 227
Re: gdb of better compiler not working
« Reply #10 on: April 19, 2024, 07:43:50 am »
Never mind I ve figured it out turns out these nightly versions do not support 13.2 yet. So I have switched to 13.1 and now it works.
I have nighties (including last one) running with 13.2 gcc (nixman) without such problems. 

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 67
  • Where there is a will, there is a way.
Re: gdb of better compiler not working
« Reply #11 on: April 19, 2024, 12:51:43 pm »
Then maybe Xaviou's build can be suitable?
« Last Edit: April 19, 2024, 12:53:36 pm by Grit Clef »
-Windows 7, 32-bit
-CodeBlocks r13518, gcc 13.2.0, debug version

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1591
Re: gdb of better compiler not working
« Reply #12 on: April 19, 2024, 01:55:30 pm »
GNU has changed the output of the "info breakpoints" command in GDB 13. From Sourceware change log:
Quote
* "info breakpoints" now displays enabled breakpoint locations of
  disabled breakpoints as in the "y-" state.  For example:

   (gdb) info breakpoints
   Num     Type           Disp Enb Address            What
   1       breakpoint     keep n   <MULTIPLE>
   1.1                         y-  0x00000000000011b6 in ...
   1.2                         y-  0x00000000000011c2 in ...
   1.3                         n   0x00000000000011ce in ...

The Enb column previously showed 'y' or 'n', now it shows 'y-' or 'n'. This may be fooling the debugger plugin.