Watching module variables with equivalence

24 views
Skip to first unread message

Fernando Molina

unread,
May 6, 2020, 12:26:35 PM5/6/20
to CBFortran
Dears,
I found that cannot watch variables inside a module when they are included in anequivalence statement
Please look at the attached project. In its present state I can set a breakpoint in the main program and watch the variables k and X0. However, if the line containing the equivalence statement is uncommented, both k and X0 show "Not available in current context!" in the watch window
Using latest CB 20.03 (Build mar 14 2020) on windows 10 x64, with gcc 9.10
Regards
cbtestdebug.7z

Darius Markauskas

unread,
May 9, 2020, 1:40:03 PM5/9/20
to cbfo...@googlegroups.com
Dear Fernando,
I can confirm this problem. I tested your example on Ubuntu 18.04 (gfortran 7.5, gdb 8.1).
The debugger plugin of C::B just starts GDB debugger. All actual debugging is performed in GDB. And this problem is on GDB or Gfortran side. Not C::B. So, I can't fix it :( .



--
You received this message because you are subscribed to the Google Groups "CBFortran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cbfortran+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cbfortran/dd02ce2f-d83e-495d-9293-710ddff040bf%40googlegroups.com.

Fernando Molina

unread,
May 9, 2020, 10:05:49 PM5/9/20
to cbfo...@googlegroups.com
OK, Thanks Darius.
I will try to file a bug in gcc site.

Darius Markauskas

unread,
May 11, 2020, 5:27:34 AM5/11/20
to cbfo...@googlegroups.com
According to the Fortran 2018 standard, Equivalence statement is an obsolescent feature (B.3.11). If you are developing a new code, you should not use this statement.

Fernando Molina

unread,
May 13, 2020, 8:17:35 AM5/13/20
to CBFortran
Wow. Didn't know. This is a code I have developed several years ago, in Fortran 2003 days. Anyway, what to use instead? I use for fitting a Levenberg-Marquardt implementation which requires the fitting parmeters to be in a 1-dimensional array X, so I use equivalence to map these to more useful names such as chi, rho, density, etc.
Thanks for your help
Fernando

El lunes, 11 de mayo de 2020, 6:27:34 (UTC-3), darmar escribió:
According to the Fortran 2018 standard, Equivalence statement is an obsolescent feature (B.3.11). If you are developing a new code, you should not use this statement.

On Sun, 10 May 2020 at 04:05, Fernando Molina <fmol...@gmail.com> wrote:
OK, Thanks Darius.
I will try to file a bug in gcc site.

El sáb., 9 de may. de 2020 a la(s) 14:40, Darius Markauskas (darm...@gmail.com) escribió:
Dear Fernando,
I can confirm this problem. I tested your example on Ubuntu 18.04 (gfortran 7.5, gdb 8.1).
The debugger plugin of C::B just starts GDB debugger. All actual debugging is performed in GDB. And this problem is on GDB or Gfortran side. Not C::B. So, I can't fix it :( .



On Wed, 6 May 2020 at 18:26, Fernando Molina <fmol...@gmail.com> wrote:
Dears,
I found that cannot watch variables inside a module when they are included in anequivalence statement
Please look at the attached project. In its present state I can set a breakpoint in the main program and watch the variables k and X0. However, if the line containing the equivalence statement is uncommented, both k and X0 show "Not available in current context!" in the watch window
Using latest CB 20.03 (Build mar 14 2020) on windows 10 x64, with gcc 9.10
Regards

--
You received this message because you are subscribed to the Google Groups "CBFortran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cbfo...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "CBFortran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cbfo...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "CBFortran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cbfo...@googlegroups.com.

Darius Markauskas

unread,
May 13, 2020, 8:42:14 AM5/13/20
to cbfo...@googlegroups.com
I do not know your code, but maybe Associate construct is for you:

To unsubscribe from this group and stop receiving emails from it, send an email to cbfortran+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cbfortran/6161d042-1591-47eb-adba-a07f07ff4f4d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages