Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Problems trying to debug in Mac OSX

Hi again folks,

well finally I hit home and had the chance to test things on my Mac box...
I can report success this time :) I seem to be able to compile and run, and also debug,
set breakpoints and have eclipse stop at them... exactly as one would expect.
I have not done intensive test, but I managed to make it work -at least with the
autogenerated makefile.
As I said before, now I use gfortran 4.6 and also had gdb 7.2 installed in 
/usr/local/bin,, which is in the path. I also have fsf-gdb (from macports) installed in
/opt/local/bin (default localtion when installed from macports).
What i did was to tell eclipse to look for fsf-gdb as a debugger
That seems to finally work...
One change I had to make to have it working: go to 
Run -> Debug Configurations -> Fortran Local Applications ->
HelloFortran (=name of my project)
on teh Debugger tab, in the 'GDB Debugger' filed I set
/opt/local/bin/fsf-gdb
and in the 'GDB command set:' I checked 'Standard' instead of 
'Standard (Mac OS)'. With the later option, which I assumed was the right one since hey! 
this IS a mac, the debugger simply crashes and complains about not being able
to find my project files (?). However in 'Standard' everything works fine...
And when I say fine, I mean to say that I can see not only local but also global 
variables in the Variables window, and works well at breakpoints...
That seems to sort out things.

Cheers,

Ferran.

On Mar 28, 2011, at 6:23 PM, Ferran Mazzanti wrote:

Hi guys,

thanks you all for your kind replies :)
Right now I'm at work and can't check on my mac. I have checked that everything works on my Ubuntu 9.10
box following the steps and advices given. But on the mac... I have to check. i have been messing around with
it so much that now I cannot tell from heart what I did. i know I have the latest gfortran installed
which is 4.6 I believe... not from the macports as 8i think) that doesn't exists there. I got it from
http://hpc.sourceforge.net/
which installs and works nicely, apparently.
Another source of potential trouble is gdb itself... the one that ships with the mac developper tools,
integrated in Xcode, is prehistoric: it is version 6.3.5 while they are already at gdb 7,2
(and I'm talking about xcode 3.2.6 which is the latest one prior to the new 4.0 release).
That *is* a source of problems also since... guess what... gdb itself can't debug global variables
in COMMON's or Module's. Only starting at gdb 7.2 that seesm to work under gfortran
(I checked release 7.0 and that was not working either). But fortunately macports does have gdb 7.2
and one can install it. It goes under the name 'fsf-gdb' instead of 'gdb' since the mac utilities
seem to require its own (pleistozenic) gdb version. So if everything works, one has to try it
with fsf-gdb, which is another source of potential trouble...

Looks like fortran and Mac OSX is a difficult combination. I may end up installing Parallels and
Ubuntu on the mac to do my fortran programming and debugging if everything else fails,
but that is far from being the optimal solution.

i'll try all that in my machine and see what comes up...

cheers,

Ferran.


DEVEL Michel wrote:
Hi,

a colleague of mine had the exact same problem that Peter described (he also uses Snow Leopard 10.6.7):
programs compile and run (both with and without debug information), but don't stop at breakpoint.

Solution: Install latest GCC / gfortran from macports (I am not a mac guy myself). In particular, it didnt work with GCC 4.2.3 but it did with 4.5!

Hi,

In fact, I have just checked that breakpoints do not work any more for my current managed Makefile project with gfortran 4.5.0 and photran 6.06 from PTP 4.0.6 under opensuse 11.3!...
I do not know since when.
--
Sincerely yours,

Michel DEVEL
------------------------------------------------------------------------

_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/photran
 


--
================================================================
Ferran Mazzanti                  e-mail: Ferran.Mazzanti@xxxxxxx
----------------------------------------------------------------
Dep. de Fisica i Enginyeria Nuclear
Universitat Politecnica de Catalunya  FAX      0034 93 401.71.00
Campus Nord, B4-B5 E-08034 Barcelona, Spain    0034 93 401.69.67
================================================================

_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/photran

================================================================
Ferran Mazzanti                  e-mail: Ferran.Mazzanti@xxxxxxx
----------------------------------------------------------------
Dep. de Fisica i Enginyeria Nuclear                             
Universitat Politecnica de Catalunya  FAX      0034 93 401.71.00
Campus Nord, B4-B5 E-08034 Barcelona, Spain    0034 93 401.69.67
================================================================ 




Back to the top