From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4204 invoked by alias); 18 May 2007 19:28:37 -0000 Received: (qmail 4149 invoked by uid 22791); 18 May 2007 19:28:35 -0000 X-Spam-Check-By: sourceware.org Received: from hunan.ucolick.org (HELO smtp.ucolick.org) (128.114.23.233) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 18 May 2007 19:28:30 +0000 Received: from smtp.ucolick.org (localhost [127.0.0.1]) by smtp.ucolick.org (Postfix) with ESMTP id E7E84377A for ; Fri, 18 May 2007 12:28:27 -0700 (PDT) Received: from [128.114.22.49] (griffin.ucolick.org [128.114.22.49]) by smtp.ucolick.org (Postfix) with ESMTP id E1E36330F for ; Fri, 18 May 2007 12:28:27 -0700 (PDT) Message-ID: <464DFE61.6060804@ucolick.org> Date: Fri, 18 May 2007 19:28:00 -0000 From: Patrik Jonsson User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: gdb@sourceware.org Subject: gdb 6.5 doesn't see local variables Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA0FE1E82B8E1382D0E1A1D11" X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-05/txt/msg00078.txt.bz2 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA0FE1E82B8E1382D0E1A1D11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2077 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 =3D 4; ExtHDU& axes_HDU =3D 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 =3D 4; (gdb) 353 ExtHDU& axes_HDU =3D 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. --------------enigA0FE1E82B8E1382D0E1A1D11 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 250 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGTf5hT+KvsdUW5p8RAvSvAJwIbvQ/ddjtjwaubY92GU2/Xam1BwCfXK4X OydxDfybeQy/z2ai4rbchzA= =Mwgh -----END PGP SIGNATURE----- --------------enigA0FE1E82B8E1382D0E1A1D11--