https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96158

--- Comment #5 from AJM <amelvill at umich dot edu> ---
Also, in case it wasn't clear,

> Breakpoint 2, boo () at a.f90:9
> 9          write(*, '(A, I3)') "moduleVar=", n
> (gdb) p n
> $2 = 123
> (gdb) p moduleVar
> No symbol "moduleVar" in current context.
> (gdb) p (integer*8)othermodule_
> $3 = 123

I did find this as a workaround (it's in the repo README.md 
https://github.com/amelvill-umich/Fortran_GDB_Common , if you haven't seen it),
but this is not ideal, because there are hundreds of common statement variables
in the module in question, of varying size and type. They're all reduced to a
single othermodule_ variable.

I hypothetically could find the address of each variable, offset, and cast,
you're right, I could also hypothetically make some kind of memory map type
that I could cast that variable to, but then that would be a giant amount of
duplicated code and an extra thing to keep in sync whenever something is added.

As far as workarounds go, if it came to that I'd rather just make a dummy
"debug" function that stored these common variables as a local variable.

Reply via email to