🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Michael Hamilton Tue, 09 Apr 2002 20:02
static variables: "no symbol X in current context"
#2283
Author: Michael Hamilton
Date: Tue, 09 Apr 2002 20:02
21 lines
1763 bytes
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?

Thanks,
Mike
Re: static variables: "no symbol X in current context"
#2291
Author: Jim Blandy
Date: Wed, 10 Apr 2002 19:27
24 lines
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?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads