Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[photran] Debugging with Photran does not work (yet) [MinGW-g95]

Hi!

Some days I posted a message asking for upcoming developments, but that did not generate any reaction. Therefore, last week I made a new attempt to install Photran on my Win-XP box and see where I came. This time I got much further than before, but like in any good adventure game, I always encounter a hobgoblin or a shopkeeper, preventing me from continuing my quest. May I ask for your patience and expertise to help me overcome the last bits?

[At the end of this message I wrote down how I installed Photran.]

My problem is about debugging. I want to "debug" my program (although at the moment nothing is wrong...): set breakpoints, step through the program, watch variables, etcetera. I could not get this to work. The compiler configuration file for mkmf.pl was set to include debugswitch -g, so the executable should be ready for gdb. I started to create a "debug configuration" from the "run" menu. In that menu I selected my currect project. Then for "Fortran application" I tried to select the executable that was just created automatically via "Search Project", but the window that offers optional executables remained empty. Instead I selected the executable via browsing on my harddrive, but when I did this, a red dot with a cross told me: "Program is not a recognized executable"! When I ignore this and save the configuration, pressing "debug" (F11) shows the same message plus the name of my executable and an additional "Not a valid archive".

--> How do I tell Photran to debug my program?

[I cross posted this message to the fora of g95 and comp.lang.fortran, but maybe this is the best place for this topic]


Regards,

Arjan



-Installation of Photran-

I started out with a perfectly well working g95 installation under MinGW-MSYS plus the MSYS development tools (for Perl) and mkmf.pl (to make a Makefile for me). I copied my currect Fortran project (which compiles and runs alright) to a test-directory, so that I could temper with the sources at lib.

Then I downloaded the latest Eclipse-Ganymede for C/C++-development. I thought that this version would be closest to a Fortran IDE. Somehow the menu Help > Softwareupdate > Available Software did not show an entry for Photran, so I downloaded the Photran .zip-file and installed from there.

I started Eclipse and ended up on the workbench. I started a new project via: File > New... > Project... and selected "Fortran project". In the window that popped up I gave in a nice name for the project and overruled the default location with the (copy) directory of my source-files. I already had a Makefile from mkmf.pl, so I selected "Makefile project" > "Empty Project" as project type.

As a result, on the left side a list of all the files in my project directory appeared, each with a + sign in front. When such a + is expanded by clicking on it, dots appear: green ones with an M on them for Modules and red ones with a P on them for programs. These Modules and Programs can be expanded to show the contained Types, Functions and Subroutines. Files with syntax errors show a skull... In my source directory, an executable is created automatically. I ran it manually from an MSYS shell and it works!

Then, on the g95-HowTo page for Photran, I read that I should construct automatic build scripts, and scripts for running and debugging. After I tried to make such an automatic build script, the list of Modules on the left of my screen did not show the nice list of P and M signs anymore. The fact that my program was already automatically built suggested to me that maybe I did not have to follow the steps on the g95-HowTo page for Photran about automatic Build scripts, so I deleted the build script.

So far so good.


Back to the top