* 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
* Re: gdb 6.5 doesn't see local variables
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
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-05-18 19:36 UTC (permalink / raw)
To: Patrik Jonsson; +Cc: gdb
On Fri, May 18, 2007 at 12:28:33PM -0700, Patrik Jonsson wrote:
> 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.
Sounds to me like:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gdb 6.5 doesn't see local variables
2007-05-18 19:36 ` Daniel Jacobowitz
@ 2007-05-18 20:57 ` Patrik Jonsson
0 siblings, 0 replies; 3+ messages in thread
From: Patrik Jonsson @ 2007-05-18 20:57 UTC (permalink / raw)
To: gdb
[-- Attachment #1: Type: text/plain, Size: 588 bytes --]
Daniel Jacobowitz wrote:
> On Fri, May 18, 2007 at 12:28:33PM -0700, Patrik Jonsson wrote:
>> 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.
>
> Sounds to me like:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574
>
Sure does. Thanks!
/Patrik
[-- 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