User forums > Using Code::Blocks

Gdb don't work with gfortran compiler

(1/2) > >>

Garibaldi:
Hi all,
I apologize for my bad english...

Normaly I use linux, and in linux I have started to use code::blocks...It is a very good program....
But in this moment I must use windows. I have to write a fortran program that receve data file generated by program that work only on Windows OS...
In linux can compile and degug any fortran program.
Instead in windows I can only compile program, but I can't debug it.

On my Pc I installed code::bock 8.02, Cygwin (but I have also MinGW32), gfortran and plug-in code::block fortran....

I have configurated the toolchain for fortran compiler.

I can add breakpoints but when debug the program, it run fully without stop.

I thought perhaps replacing gdb with a new version the problem end, but I obtained the same result.....

I'm not expert and so I don't know what to do.

I post the log:

Debugger window:


--- Code: ---Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\
Adding source dir: C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\
Adding file: bin\Debug\debugging.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.8
Child process PID: 2584
Program exited normally.
Debugger finished with status 0

--- End code ---

Debugger (debug) window:


--- Code: ---PATH=.;C:\Programmi\gfortran\bin;C:\Programmi\PC Connectivity Solution\;C:\Programmi\MiKTeX 2.8\miktex\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Programmi\PC Connectivity Solution;C:\Programmi\Symantec\Norton;c:\matlab6p5\bin\win32;C:\CYGWIN\BIN;C:\Programmi\QuickTime\QTSystem\;C:\Programmi\Universal Extractor;C:\Programmi\Universal Extractor\bin;C:\MinGW32\bin;C:\Modeltech_pe_edu_6.5d\win32pe_edu;C:\Programmi\gfortran\libexec\gcc\i586-pc-mingw32\4.5.0;C:\Programmi\Pinnacle\Shared Files;C:\Programmi\Pinnacle\Shared Files\Filter
Command-line: C:\Programmi\gfortran\bin\gdb.exe -nx -fullname  -quiet -args bin/Debug/debugging.exe
Working dir : C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined in loaded symbols.
>>>>>>cb_gdb:
> source C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\CodeBlocks-Fortran_win32_v0.3\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/DOCUME~1/Utente/DOCUME~1/prov/ENRICO~1/PROGRA~1/READ_F~1/DEBUGG~1/
>>>>>>cb_gdb:
> break "C:/Documents and Settings/Utente/Documenti/prov/EnricoCaruso/Programmi fortran/read_file/debugging/deb.f90:8"
No source file named C:/Documents and Settings/Utente/Documenti/prov/EnricoCaruso/Programmi fortran/read_file/debugging/deb.f90 in loaded symbols.
Breakpoint 1 ("C:/Documents and Settings/Utente/Documenti/prov/EnricoCaruso/Programmi fortran/read_file/debugging/deb.f90:8) pending.
>>>>>>cb_gdb:
> run
gdb: win32_init_thread_list
[New thread 2584.0xb8]
Program exited normally.
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> quit

--- End code ---

Thanks
Look your news

oBFusCATed:
Can you debug your program with gdb directly (starting gdb from cmd line)?

Garibaldi:
I could try, but I don't know how to do.
I tryed to compile and debug my program in command line in this way:

gfortran myprog.f90 -g -o myprog.exe

And then:

gdb myprog

But in this way I work with gdb installed with cygwin. This gdb version is 5.0.
It is quite old and maybe it isn't compatible with fortran.
Infact in gdb window I don't read fortran code but assembly code.

I downloaded a new version of binary gdb (gdb 7.1)
I try to run this, but I don't know how use it.

This is the result in cmd:


--- Code: ---GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
This binary was built by Equation Solution <http://www.Equation.com>.
(gdb)
--- End code ---

Thank you for the answer

oBFusCATed:
Read the manual: http://sourceware.org/gdb/download/onlinedocs/gdb/index.html
Or try to find some tutorials.
The other thing you could do is to copy the commands from the debugger's debug log, you've pasted.

Garibaldi:
Thank you very much oBFusCATed.
I read few pages of gdb manual for understanding the basic function and then I try to write similar istruction of the debugger's debug.
In this way I be able to debug my program.

But it is very singular that I can debug programs in cmd and I can't with code::blocks.

If you exame the debugger window you can see this error:

break "C:/Documents and Settings/Utente/Documenti/prov/EnricoCaruso/Programmi fortran/read_file/debugging/deb.f90:8"
No source file named C:/Documents and Settings/Utente/Documenti/prov/EnricoCaruso/Programmi fortran/read_file/debugging/deb.f90 in loaded symbols.

Program can't add the breakpoint because It doesn't find the source. But the source exist.
For this reason the program run fully, because C::B can't add any break.

I don't know because debugger don't work.
Could be the plug-in not work well in windows?

In linux I use the same plug-in and I never have problems.

I say that because I try to use no plugin. I add manualy compiler, group of file associated with compiler (.f .f90 ecc). And in this way with the same toolchain (and so with the same .exe) I can compile, debug and run any program.

The only problem was that there wasn't a default highlighting for fortran. But I resolve this replacing the directory lexar positioned in C::B fortran plug-in with the same folder positioned in the install directory of program C::B.

I wait a few day before mark this discussion how solved.
I want to be sure I solved the problem before close the conversation.

Thank you

Navigation

[0] Message Index

[#] Next page

Go to full version