PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Debugging preprocessed Fortran code with pgdbg

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
hwb



Joined: 23 May 2008
Posts: 3

PostPosted: Fri May 23, 2008 7:42 am    Post subject: Debugging preprocessed Fortran code with pgdbg Reply with quote

Hi,
I am trying to debug a F90 program which contains partially preprocessed Fortran 90 code (-Mpreprocess).
My compile flags include: -byteswapio -Minfo -Mbackslash -C -Ktrap ...
Linking with: -Bstatic -Mlfs ...
I am still using 7.0-7 pgf90 and pgdbg due to bugs in newer versions

I get a FPE and the debugger tells me where, e.g.
#3 run_fluxs_flx line: "/project/artemis/flux/source/flx_class.f90"@4452 address: 0x855348c
self = 0x1d30ffc0, lcycl = 6, converged = .FALSE., unit = 6
=> #2 fluxs_ address: 0x862aa9e
#1 rebals_ address: 0x865902c
#0 rebs_ address: 0x865d31e
So far, so good.

But pgdbg only shows assembler code for fluxs_, rebals_, and rebs_, no sources. These three sources were all preprocessed.

I can select fluxs.f90 in the source tab and the source is correctly shown. But now I can not set any breakpoints there, e.g. in fluxs.f90

And when I try to switch from disassemble to source, I get
pgdbg> Call level:1 rebals_ address: 0x865902c
ERROR: No current source file.

It seems the preprocessed sources are not available.
How do I access those preprocessed sources in the debugger so I can set breakpoints ?
Do I need additional flags? Are the preprocessed sources written to scratch and thus not available for debugging?
Any ideas would be appreciated.

Thanks,
hwb
Back to top
View user's profile
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Fri May 23, 2008 11:43 am    Post subject: Reply with quote

Hi,

You need to compile with -g to be able to see the source.

Hongyon
Back to top
View user's profile
hwb



Joined: 23 May 2008
Posts: 3

PostPosted: Mon May 26, 2008 12:36 am    Post subject: Reply with quote

I have compiled everything with -g, I just did not mentioned this in the first post.
I also mentioned that I can see the sources in pgdbg. But I can not set a breakpoint.

hwb
Back to top
View user's profile
hwb



Joined: 23 May 2008
Posts: 3

PostPosted: Mon May 26, 2008 2:05 am    Post subject: Reply with quote

OK.
I think I identified the problem myself.
I can now set breakpoints in the preprocessed sources.

It seems the root cause was an old .pgdbgrc file containing
source location pathes which somehow mixed up the source path search process in pgdbg.

hwb
Back to top
View user's profile
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Tue May 27, 2008 8:06 am    Post subject: Reply with quote

Hi,

Thanks for letting us know you found a solution.

Hongyon
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group