This is the mail archive of the gdb-prs@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]

[Bug gdb/18629] global variable


https://sourceware.org/bugzilla/show_bug.cgi?id=18629

--- Comment #2 from Roger Davis <rbd at hawaii dot edu> ---
Hi Keith,

You are correct, this sounds very much like 18436. I did do a prior search but
did not turn that one up, sorry. I'll hazard a very confident guess that this
has nothing to do with a dynamically allocated array, however, and everything
to do with non-local variable declaration. The compile-methodology workarounds
posted in comments #9-10 of 18436 do not work for me, and I'll hazard an
equally confident guess that it's because my case involves multiple source
files -- probably compilation of a single source file with those particular
commands yields the program.dSYM symbol table directory that seems to make
global variable type recognition in gdb work at this particular moment in the
MacOS/Xcode/gdb universe. Compiling separate object files and linking them in
yet another separate step does *not* result in the implicit call to dsymutil
which creates this .dSYM directory (or so I've read in another forum).

I have discovered a very half-assed partial workaround -- for simple float
variables I can successfully print them with

(gdb) p/f myglobalfloatvar

However, I've got lots of global instantiations of complex struct typedefs,
plus doubles, long doubles, etc. Yuck. And as I mentioned earlier, it's just
not practical for me to cram everything into a single source file. I think I
need an actual fix for this or I'm seriously hosed, and I expect anyone else
writing programs of any non-trivial size for MacOS will be too.

Thanks,

Roger

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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