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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joel Brobecker wrote:
>
> I wonder why that is. Is this the file where function "main" is
> reported to be?
>
Yes, it seems that way. The problem is: in that sample code I sent in
my first post, there's no function "main".  If GDB assumes that it
will always be like:

program main
    ...blah blah
end

it'll never work for something like:

program foo
    ... blah blah
end

If I change the name of my Fortran program to "main", I can set a
breakpoint by line number inside it. So it seems that GDB is only
looking for "main". This is fine for C, but it won't work for Fortran
IMHO, not even using that patch Daniel posted. So, I believe we should
address this issue in symtab.c:find_main_name. I can start looking
into it.

In the scenario above, a breakpoint by line number inside a function
will fail. I think this may has to do with the compiler generating two
DWARF compilation units (one for "main" and other for the function)
and GDB is not reading the one related to the function. What are your
thoughts about this?

Regards,

- --
Carlos Eduardo Seo
Software Engineer
IBM Linux Technology Center
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFG+UOZqvq7Aov/qQARAgXlAJ0fa3E/Dv15WNFHB9s0uODC/YUKXQCY1xhJ
9jNxJPlD98kMq1XIuFE6pA==
=3bWB
-----END PGP SIGNATURE-----


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