Author Topic: Can't Debug FORTRAN Program  (Read 403 times)

Offline toml12953

  • Single posting newcomer
  • *
  • Posts: 3
Can't Debug FORTRAN Program
« on: July 28, 2020, 08:01:07 pm »
I'm using Code::Blocks 20.03 on Windows 10 (64-bit) and use MSYS2-64 with its gfortran compiler and GDB debugger.
I can compile and link a program with no problem and I can run through the entire program from Debug. When I try to step through the program, however, I get the output below. I have full rights to the source directory and all the code in it. It's not just this one program but any program I try to debug that causes the error.

Starting debugger: C:\msys64\usr\bin\gdb.exe -nx -fullname -quiet  -args "D:/LANGS/FORTRAN/Calculating PI/bin/Debug/Calculating PI.exe"
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 9.2
Child process PID: 16472
Cannot open file: /d/LANGS/FORTRAN/Calculating PI/montecarlo.f90
At /d/LANGS/FORTRAN/Calculating PI/montecarlo.f90:13

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6957
    • My Best Post
Re: Can't Debug FORTRAN Program
« Reply #1 on: July 28, 2020, 08:55:20 pm »
Why are you using "C:\msys64\usr\bin\gdb.exe" instead of the mingw64 64-bit or 32-bit gdb?
NOTE: This is assuming you are using the MSys2 Mingw64 FORTRAN compiler.

Code: [Select]
$ pacman -Qo /mingw64/bin/gdb.exe
/mingw64/bin/gdb.exe is owned by mingw-w64-x86_64-gdb 9.2-1

Tim S.
« Last Edit: July 28, 2020, 08:58:06 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline toml12953

  • Single posting newcomer
  • *
  • Posts: 3
Re: Can't Debug FORTRAN Program
« Reply #2 on: July 28, 2020, 10:05:28 pm »
Why are you using "C:\msys64\usr\bin\gdb.exe" instead of the mingw64 64-bit or 32-bit gdb?
NOTE: This is assuming you are using the MSys2 Mingw64 FORTRAN compiler.

Code: [Select]
$ pacman -Qo /mingw64/bin/gdb.exe
/mingw64/bin/gdb.exe is owned by mingw-w64-x86_64-gdb 9.2-1

Tim S.

Does this have something to do with my problem? In any case, Here's what I get:

Code: [Select]
$ pacman -Qo /mingw64/bin/gdb.exe
error: No package owns /mingw64/bin/gdb.exe

Tom L

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6957
    • My Best Post
Re: Can't Debug FORTRAN Program
« Reply #3 on: July 29, 2020, 05:30:11 am »
What compiler are you using!
You need to use a debugger that works with the compiler you are using.

The MSys2 system has three choices MSys2 (Cygwin like tools), MinGW64 64 bit tools, or MinGW64 32 bit tools. You need to decide which of the three you are going to use! Then use only that one!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline toml12953

  • Single posting newcomer
  • *
  • Posts: 3
Re: Can't Debug FORTRAN Program
« Reply #4 on: July 29, 2020, 07:42:58 am »
What compiler are you using!
You need to use a debugger that works with the compiler you are using.

The MSys2 system has three choices MSys2 (Cygwin like tools), MinGW64 64 bit tools, or MinGW64 32 bit tools. You need to decide which of the three you are going to use! Then use only that one!

Tim S.

I'm a FORTRAN programmer. I know nothing of MSYS or anything like that. I found the place where the debugger was pointing to the wrong place, though. It's working now. Thanks for your help!

« Last Edit: July 29, 2020, 07:58:47 am by toml12953 »