Article View: gnu.gdb.bug
Article #2291Re: static variables: "no symbol X in current context"
From: Jim Blandy
Date: Wed, 10 Apr 2002 19:27
Date: Wed, 10 Apr 2002 19:27
24 lines
1818 bytes
1818 bytes
michaeljohnhamilton@cox.net (Michael Hamilton) writes: > System: Linux 2.2.16-22 (Redhat 7.?) > GDB 5.0 (run inside of xemacs) > > I don't know if this is a bug or just my problem, but, I haven't been > able to figure out how to fix it despite looking at FAQs and docs and > websearches. > > I have a local variable declared static in a subroutine my code. In > gdb, when inside the subroutine, I use > > > p x > No symbol "x" in current context. > > This only seems to happen when running GDB on Linux. When I run it on > a solaris/sun machine, it gives me the value. Non-static vars seem to > work fine. > > What am I missing? I'm able to print function-local static variables fine. Can you provide a specific test case we can compile to see the problem on our own systems?
Technical Details
Message-ID:
<np662ze4lu.fsf@zwingli.cygnus.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!news.voicenet.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdbReferences:
<fb04c8e9.0204091202.fe8d509@posting.google.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,437ba9ac83d5b05 X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 2002-04-10 12:31:13 PST x-uunet-gateway: dfw7sosrv11.alter.net from bug-gdb to gnu.gdb.bug; Wed, 10 Apr 2002 19:28:44 GMT Sender: jimb@zwingli.cygnus.com Subject: Re: static variables: "no symbol X in current context" References: <fb04c8e9.0204091202.fe8d509@posting.google.com> From: jimb@redhat.com (Jim Blandy) Date: 10 Apr 2002 14:27:41 -0500 Message-ID: <np662ze4lu.fsf@zwingli.cygnus.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Approved: bug-gdb-request@mail.gnu.org Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!news.voicenet.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb Lines: 24