For Programmers: Free Programming Magazines  


Home > Archive > Fortran > March 2007 > funny variable names in gdb









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author funny variable names in gdb
jadoo.dost@gmail.com

2007-03-28, 7:09 pm

Hi,
after a bit of tinketing i'm finally able to see my source code but:

variables such as:
CPU_2=3D0
get funny names as illustrated below:


(gdb) info variable cpu_2
All variables matching regular expression "cpu_2":

File globals.f90:
real8 globals_MP_cpu_2;
real8 globals_MP_cpu_2a;

where does that MP come from ??? & what happened to the case ?
also what do i make out of the following information

(gdb) info variable n_vec
All variables matching regular expression "n_vec":

File globals.f90:
struct array1 globals_MP_n_vec;
real8 globals_MP_n_vec.data[11];
(gdb) print globals_MP_n_vec@2
$3 =3D {{
offset =3D 0x2c9138 "?=EF=A3=BF",
rank =3D 1,
esize =3D 8,
base =3D 0x2c9138,
info =3D {8, 0, 10}
}, {
offset =3D 0x3ff00000 <Address 0x3ff00000 out of bounds>,
rank =3D 0,
esize =3D 1072693248,
base =3D 0x0,
info =3D {0, 0, 0}
}}
(gdb)

--- platform info ------------
compiler: g95 Options: -g3 -gstabs -pg -ftrace=3Dfull
OS: Mac OS X
front-end: ddd
importrant libraries: MPI
I am able to view the source code in ddd

robert.corbett@sun.com

2007-03-28, 10:11 pm

On Mar 28, 3:05 pm, "jadoo.d...@gmail.com" <jadoo.d...@gmail.com>
wrote:
> Hi,
> after a bit of tinketing i'm finally able to see my source code but:
>
> variables such as:
> CPU_2=0
> get funny names as illustrated below:
>
> (gdb) info variable cpu_2
> All variables matching regular expression "cpu_2":
>
> File globals.f90:
> real8 globals_MP_cpu_2;
> real8 globals_MP_cpu_2a;
>
> where does that MP come from ??? & what happened to the case ?


The compiler added it to "uniquify" the name. Uppercase
is used to avoid conflicts with user names. The usual
convention would be that cpu_2 and cpu_2a would be names
global or local static names in a scoping unit named
globals. If you defined objects named cpu_2 and cpu2a
in another scoping unit, they would be given a different
prefix.

Bob Corbett

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com