Author Topic: Gdb don't work with gfortran compiler  (Read 8456 times)

Offline Garibaldi

  • Single posting newcomer
  • *
  • Posts: 5
Gdb don't work with gfortran compiler
« on: July 30, 2010, 10:08:30 pm »
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

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

Thanks
Look your news

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Gdb don't work with gfortran compiler
« Reply #1 on: July 30, 2010, 10:33:36 pm »
Can you debug your program with gdb directly (starting gdb from cmd line)?
(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 Garibaldi

  • Single posting newcomer
  • *
  • Posts: 5
Re: Gdb don't work with gfortran compiler
« Reply #2 on: July 31, 2010, 09:51:58 am »
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)

Thank you for the answer

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Gdb don't work with gfortran compiler
« Reply #3 on: July 31, 2010, 10:52:59 am »
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.
(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 Garibaldi

  • Single posting newcomer
  • *
  • Posts: 5
Re: Gdb don't work with gfortran compiler
« Reply #4 on: July 31, 2010, 04:38:50 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7589
    • My Best Post
Re: Gdb don't work with gfortran compiler
« Reply #5 on: July 31, 2010, 04:50:54 pm »
Have you tried using a project path without spaces in it?

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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Gdb don't work with gfortran compiler
« Reply #6 on: July 31, 2010, 10:23:32 pm »
Garibaldi: do you use the same versions of gdb on windows and linux?
I think gdb devs improved the pending breakpoints a lot in 7.0+

Also read this (I you haven't): http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks#Notes_on_Setting_Breakpoints
Can you post a log from working gdb session?
Can you debug a simple hello world project, C/C++ and Fortran?
(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 Garibaldi

  • Single posting newcomer
  • *
  • Posts: 5
Re: Gdb don't work with gfortran compiler
« Reply #7 on: August 02, 2010, 12:13:45 pm »
stahta01:
I think that it isn't the problem. Now I work in the same folder with the same progect but without fortran plug-in and now debug work.
I try to use as path name: "C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\forran\prova\"
But there are spaces in "Documents and Settings". Do I try to use a path like "C:\Fortran"?

oBFusCATed:
In linux I use C::B 8.02 like Windows but gdb version is 7.1 (In windows I use 6.8 default).
I try to use in windows gdb 7.1, but debugger don't work.
I never read notes on setting break point. That text explain limits are for gdb version early 6.7 (I use 6.8). This limits apply only particulary istruction instead I couldn't debug a hello word program!

Now I haven't problem with this solution, I haven't interested in using plug-in. This solution is very good. I can compile, debug and I have highlighting. It is perfect.

For example I use this simple code for post you a log of working gdb session:

Code
program deba
implicit none

integer :: i

do i=1, 10
    write (*,*) "mandi"
end do

end program deba

I set a breakpoint on write istruction.
And I add varable i on watch window.

This is the result:

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\Prova_definitiva\
Adding source dir: C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\
Adding file: bin\Debug\Prova_definitiva.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: 2120
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2
At C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:10
In __mingw_CRTStartup () ()
Program exited normally.
Debugger finished with status 0


Debugger (debug) window:

Code
PATH=.;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\gfortran\bin;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/Prova_definitiva.exe
Working dir : C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\Prova_definitiva\
> 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:
> directory C:/DOCUME~1/Utente/DOCUME~1/prov/ENRICO~1/PROGRA~1/READ_F~1/PROVA_~1/
>>>>>>cb_gdb:
> directory C:/DOCUME~1/Utente/DOCUME~1/prov/ENRICO~1/PROGRA~1/READ_F~1/
>>>>>>cb_gdb:
> break "C:/Documents and Settings/Utente/Documenti/prov/EnricoCaruso/Programmi fortran/read_file/debugging/deb.f90:8"
Breakpoint 1 at 0x40135d: file C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90, line 8.
>>>>>>cb_gdb:
> run
gdb: win32_init_thread_list
[New thread 2120.0xb28]
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
Current language:  auto; currently fortran
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> info locals
i = 1
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
1>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 1
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
1>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 2
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
2>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 2
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
2>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 3
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
3>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 3
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
3>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 4
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
4>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 4
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
4>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 5
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
5>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 5
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
5>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 6
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
6>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 6
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
6>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 7
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
7>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 7
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
7>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 8
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
8>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 8
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
8>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 9
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
9>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 9
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
9>>>>>>cb_gdb:
> next
Breakpoint 1, deba () at C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:8:61:beg:0x40135d
>>>>>>cb_gdb:
> info locals
i = 10
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
10>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:2:2:beg:0x4013bf
>>>>>>cb_gdb:
> info locals
i = 10
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
10>>>>>>cb_gdb:
> next
C:\Documents and Settings\Utente\Documenti\prov\EnricoCaruso\Programmi fortran\read_file\debugging\deb.f90:10:94:beg:0x4013d0
>>>>>>cb_gdb:
> info locals
i = 11
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> whatis i
type = integer(kind=4)
>>>>>>cb_gdb:
> output i
11>>>>>>cb_gdb:
> next
0x004010db in __mingw_CRTStartup ()
>>>>>>cb_gdb:
> info locals
No symbol table info available.
>>>>>>cb_gdb:
> info args
No symbol table info available.
>>>>>>cb_gdb:
> whatis i
No symbol "i" in current context.
>>>>>>cb_gdb:
> output i
No symbol "i" in current context.
>>>>>>cb_gdb:
> next
Single stepping until exit from function __mingw_CRTStartup,
which has no line number information.
Program exited normally.
>>>>>>cb_gdb:
> quit

It's perfect!

I try to debug more complex program (for example program that work with data file) and debugger work. Now I have to try debug program with calls and with more code file. This is the reason because I don't mark discussion solved.

When you say me:
"Can you debug a simple hello world project, C/C++ and Fortran?"

Do you mean compile and debug mixed code (c and fortran together)?

This kind of operation is not needed for my progect.

Thanks to all

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Gdb don't work with gfortran compiler
« Reply #8 on: August 02, 2010, 12:50:40 pm »
Do you mean compile and debug mixed code (c and fortran together)?
No, I was suggesting to try to debug hello world c/c++ project and separately hello world fortran project.
This was to verify that the debugger is working.
(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 Garibaldi

  • Single posting newcomer
  • *
  • Posts: 5
Re: Gdb don't work with gfortran compiler
« Reply #9 on: August 02, 2010, 01:57:14 pm »
I try to debug a C project and a fortran project and debugger work in both cases. I think now there is no problem.