public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "wkf at alum dot mit dot edu" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug c++/9708] New: Unable to print static variable inside class member function
Date: Sun, 04 Jan 2009 23:31:00 -0000	[thread overview]
Message-ID: <20090104233143.9708.wkf@alum.mit.edu> (raw)

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.


             reply	other threads:[~2009-01-04 23:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-04 23:31 wkf at alum dot mit dot edu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090104233143.9708.wkf@alum.mit.edu \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).