Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb 6.5 doesn't see local variables
@ 2007-05-18 19:28 Patrik Jonsson
  2007-05-18 19:36 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Patrik Jonsson @ 2007-05-18 19:28 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]

Hi all,

I'm trying to debug a C++ program (compiled with gcc 4.1.1) with gdb
6.5-15.fc6rh (on a FC6 x86_64 machine), and I'm experiencing a most
vexing problem.  I'm breaking the program in a constructor and want to
look at the local variables, but gdb says there are no such symbols in
the current context. The program is compiled with -g -O0.

Here's some code:

mcrx::mappings_stellarmodel::mappings_stellarmodel(Preferences& p,
						   const nbody_data_grid& gr) :
  prefs(p), g(gr), axes(4), middle_axes(4),
  use_teff(prefs.defined("use_teff") && prefs.getValue("use_teff", bool()))
{
  using namespace boost::lambda;

  FITS input_file("/home/patrik/mappings/Zmodels.fits", Read );
  Array< T_float, 4 > temp;
  read (input_file.pHDU(), temp);
  // to get in increasing wavelength order
  temp.reverseSelf(fourthDim);
  // and transpose (z, t, 0/1, l) to get axes to be (0/1, t, Z, l)
  temp.transposeSelf(thirdDim, secondDim, firstDim, fourthDim);
  int crapass = 4;
  ExtHDU& axes_HDU = open_HDU (input_file, 1);

The details are not important, but as you can see, p and gr are
parameters, and input_file, temp, and crapass are local variables.

When I stop gdb on the final line, I can do this:

352       int crapass = 4;
(gdb)
353       ExtHDU& axes_HDU = open_HDU (input_file, 1);
(gdb) p crapass
No symbol "crapass" in current context.
(gdb) info scope 353
Scope for 353:
Symbol this is a variable with complex or multiple locations (DWARF2),
length 8.
Symbol p is a variable with complex or multiple locations (DWARF2),
length 8.
Symbol gr is a variable with complex or multiple locations (DWARF2),
length 8.

As you can see, only the this pointer and the parameters to the
constructor are recognized, it's as if the local variables don't exist.
 They are there, I can step into the calls to their member functions and
examine them, but they are missing from the gdb symbol table. If I step
up to the overlying stack frames, I can see those variables fine.

Does anyone have any idea what could be causing this and how to fix it?

thanks,

/Patrik J.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-18 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-18 19:28 gdb 6.5 doesn't see local variables Patrik Jonsson
2007-05-18 19:36 ` Daniel Jacobowitz
2007-05-18 20:57   ` Patrik Jonsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox