public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/9708] New: Unable to print static variable inside class member function
@ 2009-01-04 23:31 wkf at alum dot mit dot edu
  2010-01-22 21:47 ` [Bug c++/9708] " tromey at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: wkf at alum dot mit dot edu @ 2009-01-04 23:31 UTC (permalink / raw)
  To: gdb-prs

Inside a class definition in a cpp file, I have a member function in which I
created a 'static bool spin = true;' variable.  In the debugger, when inside
that function, I was unable to 'print spin' or 'set spin = 0' as it says "No
symbol "spin" in current context."

Work around is to move the static variable declaration outside the class to top
level of the file.

This was on:

Linux b64-centos4x32 2.6.9-78.0.8.EL #1 Wed Nov 19 19:43:32 EST 2008 i686 athlon
i386 GNU/Linux

With compiler g++:

g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10)
Copyright (C) 2006 Free Software Foundation, Inc.

-- 
           Summary: Unable to print static variable inside class member
                    function
           Product: gdb
           Version: 6.8
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: wkf at alum dot mit dot edu
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=9708

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/9708] Unable to print static variable inside class member function
  2009-01-04 23:31 [Bug c++/9708] New: Unable to print static variable inside class member function wkf at alum dot mit dot edu
@ 2010-01-22 21:47 ` tromey at redhat dot com
  2010-01-26 18:05 ` tromey at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2010-01-22 21:47 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-22 21:47:14
               date|                            |


http://sourceware.org/bugzilla/show_bug.cgi?id=9708

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/9708] Unable to print static variable inside class member function
  2009-01-04 23:31 [Bug c++/9708] New: Unable to print static variable inside class member function wkf at alum dot mit dot edu
  2010-01-22 21:47 ` [Bug c++/9708] " tromey at redhat dot com
@ 2010-01-26 18:05 ` tromey at redhat dot com
  2010-01-26 21:47 ` tromey at redhat dot com
  2010-03-13  0:37 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2010-01-26 18:05 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-01-26 18:05 -------
I have a patch pending for expr-cumulative;
I'll also push it upstream once the necessary prerequisites
are pushed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware dot|tromey at redhat dot com
                   |org                         |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-01-22 21:47:14         |2010-01-26 18:05:00
               date|                            |


http://sourceware.org/bugzilla/show_bug.cgi?id=9708

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/9708] Unable to print static variable inside class member function
  2009-01-04 23:31 [Bug c++/9708] New: Unable to print static variable inside class member function wkf at alum dot mit dot edu
  2010-01-22 21:47 ` [Bug c++/9708] " tromey at redhat dot com
  2010-01-26 18:05 ` tromey at redhat dot com
@ 2010-01-26 21:47 ` tromey at redhat dot com
  2010-03-13  0:37 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2010-01-26 21:47 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |11211
              nThis|                            |


http://sourceware.org/bugzilla/show_bug.cgi?id=9708

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/9708] Unable to print static variable inside class member function
  2009-01-04 23:31 [Bug c++/9708] New: Unable to print static variable inside class member function wkf at alum dot mit dot edu
                   ` (2 preceding siblings ...)
  2010-01-26 21:47 ` tromey at redhat dot com
@ 2010-03-13  0:37 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2010-03-13  0:37 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2010-03-13 00:27 -------
Subject: Bug 9708

CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2010-03-13 00:27:12

Modified files:
	gdb            : ChangeLog dwarf2read.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.cp: m-static.cc m-static.exp 

Log message:
	gdb
	PR c++/9708:
	* dwarf2read.c (die_needs_namespace) <DW_TAG_variable>: A variable
	in a lexical block does not need a namespace.
	(new_symbol) <DW_TAG_variable>: Put extern variables on
	list_in_scope in all cases.
	gdb/testsuite
	PR c++/9708:
	* gdb.cp/m-static.exp: Add regression test.
	* gdb.cp/m-static.cc (method): New method.
	(main): Call it.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11474&r2=1.11475
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.365&r2=1.366
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2173&r2=1.2174
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/m-static.cc.diff?cvsroot=src&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/m-static.exp.diff?cvsroot=src&r1=1.9&r2=1.10


------- Additional Comments From tromey at redhat dot com  2010-03-13 00:37 -------
Fix checked in.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|6.8                         |7.2


http://sourceware.org/bugzilla/show_bug.cgi?id=9708

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2010-03-13  0:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-04 23:31 [Bug c++/9708] New: Unable to print static variable inside class member function wkf at alum dot mit dot edu
2010-01-22 21:47 ` [Bug c++/9708] " tromey at redhat dot com
2010-01-26 18:05 ` tromey at redhat dot com
2010-01-26 21:47 ` tromey at redhat dot com
2010-03-13  0:37 ` tromey at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).