Author Topic: Can't step into standard libs functions with CB 20.03 minGW  (Read 2313 times)

Offline gorgo

  • Single posting newcomer
  • *
  • Posts: 1
Can't step into standard libs functions with CB 20.03 minGW
« on: November 09, 2021, 04:44:26 pm »
Hi all,
I installed CB from scratch (including all) on my Win10 machine using codeblocks-20.03mingw-setup.exe.

I tried the embedded debugger, but as soon as I click on "Step into" button while the yellow cursor is selecting a standard lib function (e.g. printf()), it goes to the next line instead.
I found that stdio.h (and many more headers) are in C:\Program Files\CodeBlocks\MinGW\x86_64-w64-mingw32\include while C:\Program Files\CodeBlocks\MinGW\include contains few headers only (e.g. ansidecl, bfd, bfdlink, limangle, symcat..).

On another machine I installed CB and Mingw separately and I can find all the headers into C:\MinGW\include. In this second machine I can successfully step into the printf header.

Thank you

Offline AndrewCot

  • Almost regular
  • **
  • Posts: 248
Re: Can't step into standard libs functions with CB 20.03 minGW
« Reply #1 on: November 10, 2021, 12:14:07 am »
I have a setup where I can swap between a number of Windows GCC compilers. Saying this my configuration does NOT include a configuration using the codeblocks-20.03mingw-setup.exe as this would not allow me to easily change compilers.

I do have the following MinGW variations:
  * Original MINGW - not tested or checked as I do not recommend this as MinGW32 and MinGW64 are allot better IMHO.
  * MinGW32 as installed via the "https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe" installer
  * MinGW32 with an updated GDB 10.2.90 as the GDB shipped with MinGW32 has issues.
  * MinGW64 as installed via the "https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe" installer
  * MinGW64 with an updated GDB 10.2.90 as the GDB shipped with MinGW64 has issues.

My testing results are:
  * MinGW32 with supplied GDD 8.1 does not step sprintf(...)
  * MinGW32 with an updated GDB 10.2.90 does not step sprintf(...)
  * MinGW64 with supplied GDD 8.1 does not step sprintf(...)
  * MinGW64 with an updated GDB 10.2.90 can step sprintf(...)

My conclusion is to update GDB, which can be found in the following GitHub repo, but be aware that there are other GDB versions available and also later versions:
   https://github.com/ssbssa/gdb/releases

Another option is to try a different GCC compiler environment. One option is MSYS2 as it is updated allot more often. The URL for the MSYS2 installer is:
https://sourceforge.net/projects/msys2/files/Base/msys2-x86_64-latest.exe