From: "Eli Zaretskii" <eliz@gnu.org>
To: tj <999alfred@comcast.net>
Cc: gdb@sources.redhat.com
Subject: Re: Cann't print local vars when nesting functions
Date: Sat, 19 Feb 2005 22:27:00 -0000 [thread overview]
Message-ID: <01c516b5$Blat.v2.4$ade6c180@zahav.net.il> (raw)
In-Reply-To: <42176883.2020508@comcast.net> (message from tj on Sat, 19 Feb 2005 11:25:39 -0500)
> Date: Sat, 19 Feb 2005 11:25:39 -0500
> From: tj <999alfred@comcast.net>
> CC: gdb@sources.redhat.com
>
> I am on linux, 2.4.26 kernel
> gcc 3.2.3
> gdb 5.3
> Source file test.c:
> #include <stdio.h>
>
> int main(int argc, char *argv[]){
>
> int i,j;
> int inside(void){
> int k,l;
>
> k = 1;
> l = k;
> return 0;
>
> }
>
> i = 0;
> j = 1;
> }
>
> test$ cc -g -O0 test.c
> $ gdb ./a.out
> GNU gdb 5.3
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i386-slackware-linux"...
> (gdb) b test.c:16
> Breakpoint 1 at 0x8048340: file test.c, line 16.
> (gdb) run
> Starting program: test/a.out
>
> Breakpoint 1, main () at test.c:16
> 16 j = 1;
> (gdb) p i
> No symbol "i" in current context.
> (gdb)
Well, all I can say that with GDB 6.1 and 6.3 I don't see this
problem. Unless someone who knows more than I do about problems
specific to GNU/Linux, I'd suggest to upgrade to newer versions of GCC
and GDB, and see if the problem goes away.
next prev parent reply other threads:[~2005-02-19 19:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-19 1:00 Jeff
2005-02-19 16:25 ` Eli Zaretskii
2005-02-19 19:03 ` tj
2005-02-19 22:27 ` Eli Zaretskii [this message]
2005-02-20 8:35 ` tj
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='01c516b5$Blat.v2.4$ade6c180@zahav.net.il' \
--to=eliz@gnu.org \
--cc=999alfred@comcast.net \
--cc=gdb@sources.redhat.com \
/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