News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

[FIXED] Debugger issue [update of gdb needed]

Started by thierryv, August 31, 2022, 08:43:11 AM

Previous topic - Next topic

thierryv

Hello to all of you;

I'm having a small problem with the code blocks debugger, when I try to start debugging, it opens the windows terminal and when I push any key, it closes the terminal and stops debugging... does anyone have any ideas?

(the following is the message I get at the end of the debugging)

Quote
Set variable: PATH=.;C:\Program Files\CodeBlocks\MinGW\bin;C:\Program Files\CodeBlocks\MinGW;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files\Amazon Corretto\jdk18.0.1_10\bin;C:\Python310\Scripts;C:\Python310;C:\Program Files\Python310\Scripts;C:\Program Files\Python310;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:\ProgramData\chocolatey\bin;C:\msys64\mingw64\bin;C:\MinGW\MinGW\bin;C;C:\Users\GodMode\AppData\Local\Microsoft\WindowsApps;C:\Users\GodMode\AppData\Local\Programs\Microsoft VS Code\bin
Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/JohnD/DOCUME~1/EXERCI~1/RVISIO~2/Ex_6/Ex_6/bin/Debug/Ex_6.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Child process PID: 1528
[Inferior 1 (process 1528) exited normally]
Debugger finished with status 0


Miguel Gimenez

Did you set a breakpoint or select "Run to cursor"?


thierryv

I did place some breakpoints,
but as soon as the debugger arrives at the breakpoint I have the impression that it closes the terminal and continues the program normally.

BlueHazzard

I think your program just terminates. Have you tried to single step after the breakpoint?

To gatter more information to help you better please activate the full debug log in
Settings->Debugger->Common->Enable full (debug) log
and post it here (like you did in the first post. Thank you for that! but we need the full log to help you more)

gd_on

I remember than with old gdb versions, there was sometimes problems when it was placed in a path containing a space character. It's the case here (Program Files).
Try to copy your compiler installation at the root, for example C:\MinGW. Adjust paths in C::B and retry.
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

thierryv

I can't even reply to my own thread:'( the site doesn't want it, what a day

thierryv

A BIG thank you for your help in any case.

I still have a strange thing, when I click on the red arrow, the terminal opens and closes, I have a message that flashes in Cccc that I managed to take by chance.

I have some problem to post the debugger log, the site doesn't want to apparently. even with quote or code.

BlueHazzard

This forum software absolutely does not like some non ascii charachters, so if the log has non ascii characters the best would be to put it in a txt file and attach it here

thierryv


thierryv

Quote from: BlueHazzard on August 31, 2022, 05:15:30 PM
This forum software absolutely does not like some non ascii charachters, so if the log has non ascii characters the best would be to put it in a txt file and attach it here

THANKS ! :D

BlueHazzard

Yea, also gdb does not like non ascii charachters, i would move your project from the sub folder "R##visions_Ludo" to something with only ascii characters.

Actually i do not know if gdb does not like it or how we call gdb... Anyway i would only use ascii characters in paths (and probably _ instead of spaces, but this is a personal preference)

thierryv

So I replaced my exercise folder and placed it in the root of "C:\" I also placed the debugger in "C:\MinGW" but nothing happens, the terminal doesn't pop when I press the red arrow to start the debugging.
I also installed "Msys64" to try with something else, but ... no

thierryv

By moving the location of the compiler and debugger to "C:\CodeBlocks\MinGW\Bin" the terminal appears well, but disappears almost as quickly, but still no possibility to do step by step, or go into.

BlueHazzard

[debug]"C:/Programmations/Ex_6/bin/Debug/Ex_6.exe": not in executable format: File format not recognized
[debug](gdb)

ok, now it is getting funny...

Does the exe exists?
Try to recompile your project:
From the drop down menu near the green arrow select "debug"
Now rebuild the target with the blue circle arrows or Build->Rebuild
then try again...

QuoteI also installed "Msys64"
ow... this could now lead to problems like you are seeing...

BlueHazzard

From your last log
Quote[debug][Thread 4760.0x2dbc exited with code 0]
[debug][Inferior 1 (process 4760) exited normally]
This indicates that your program exits before it reaches the breakpint...
Try to add the breakpoint at the first line in the main function and then single step trough (not by using the red arrow, but the single step button)