This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems while debugging fortran


> > I think Daniel was right on the spot. You are trying to use the
> > "current source file" concept right at the start of your session
> > assuming that it is automatically set to the source file where
> > you main is defined. Is that correct?
> Yes. And the problem is that the current file is set as "init.c".

I wonder why that is. Is this the file where function "main" is
reported to be?

> > We can certainly work on modifying GDB to be
> > better at finding the name of the main procedure in a Fortran program
> > (just like we do with Ada programs).
> Any ideas where can we start?

In terms of the GDB implementation, you can start by looking at what
we do in symtab.c:find_main_name(). What you need to do is find a way
for GDB to determine what the name of the main routine is. See the
comment I inserted that explains also that we should not have any
false positive.

In terms of the Fortran compiler, I don't know how things are setup,
so I don't know how it actually needs to be done, or if it's doable
at all, actually.  It looks like, from the patch that Daniel posted,
that this routine is always called "MAIN__". Is that the case?

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]