public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ludovic at ludovic-brenta dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/37245]  New: GDB reports "No definition of "var1" in current context." for an existing variable
Date: Tue, 26 Aug 2008 17:42:00 -0000	[thread overview]
Message-ID: <bug-37245-286@http.gcc.gnu.org/bugzilla/> (raw)

Initially reported as a GDB bug:
http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=2512

but changing the compiler to GCC 4.2 eliminates the problem, so this is a GCC
bug.  Bug description reproduced here for convenience:

Steps to reproduce:
1) Save the attached file "gdb_bug_2.adb"
2) gnatmake -ggdb3 -O0 gdb_bug_2
3) gdb ./gdb_bug_2
4) break breakpoint
5) run
6) print var1
7) print var2

Expected results:
6) gdb prints 42 as the value of var1
7) gdb prints 43 as the value of var2

Actual results
6) gdb prints "No definition of "var1" in current context."
7) gdb prints 43 as the value of var2

More info:
1) Fun2 is not called at all. However, if I remove fun2 from the program gdb is
able to print the value of var1 correctly.
2) Fitg5 does not use its arguments. However, if I change the type of argument
from real_vector to natural gdb is again able to print the value of var1
correctly.
3) Versions of relevant debian packages are

ii  gcc-4.3                           4.3.1-9                           The GNU
C compiler
ii  gdb                               6.8-3                             The GNU
Debugger
ii  gnat-4.3                          4.3.1-2                           The GNU
Ada compiler

4) Please let me know if you can't reproduce the problem, I am happy to provide
more info!


From: Rod Kay <rodkay@dodo.com.au>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: ada/2512: can not find definition of an ada variable with gdb
Date: Tue, 26 Aug 2008 14:02:42 +1000

 Results on Ubuntu 'Hardy' (up-to-date):

 - Linux orth 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 
 GNU/Linux
 - gcc version 4.1.3 20080522 for GNAT GPL 2008 (20080521)
 - GNU gdb 6.6 for GNAT GPL 2008 (20080521) [rev:131253]


 (gdb) print var1
 $1 = 42
  (gdb) print var2
 $2 = 43



    Hope this helps ...


 cheers,
 Charlie.

From: Timo Juhani Lindfors <timo.lindfors@iki.fi>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: ada/2512: can not find definition of an ada variable with gdb
Date: Tue, 26 Aug 2008 09:42:25 +0300

 ubuntu hardy
 ii  gcc-4.2                              4.2.3-2ubuntu7                      
The GNU C compiler
 ii  gdb                                  6.8-1ubuntu2                        
The GNU Debugger
 ii  gnat                                 4.2.3-1ubuntu6                      
The GNU Ada compiler

 => "$1 = 42"

 ubuntu hardy
 ii  gcc-4.1                              4.1.2-21ubuntu1                     
The GNU C compiler
 ii  gdb                                  6.8-1ubuntu2                        
The GNU Debugger
 ii  gnat-4.1                             4.1.2-16ubuntu3                     
The GNU Ada compiler

 => "$1 = 1"

 debian unstable
 ii  gcc-4.1                              4.1.2-23                            
The GNU C compiler
 ii  gdb                                  6.8-3                               
The GNU Debugger
 ii  gnat-4.1                             4.1.2-20                            
The GNU Ada compiler

 => "$1 = 1"

 debian unstable
 ii  gcc-snapshot                         20080802-1                          
A SNAPSHOT of the GNU Compiler Collection

 => "No definition of "var1" in current context."


-- 
           Summary: GDB reports "No definition of "var1" in current
                    context." for an existing variable
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic at ludovic-brenta dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37245


             reply	other threads:[~2008-08-26 17:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-26 17:42 ludovic at ludovic-brenta dot org [this message]
2008-08-26 17:44 ` [Bug ada/37245] " ludovic at ludovic-brenta dot org
2008-08-26 17:50 ` ludovic at ludovic-brenta dot org

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=bug-37245-286@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).