public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/37245]  New: GDB reports "No definition of "var1" in current context." for an existing variable
@ 2008-08-26 17:42 ludovic at ludovic-brenta dot org
  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
  0 siblings, 2 replies; 3+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2008-08-26 17:42 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/37245] GDB reports "No definition of "var1" in current context." for an existing variable
  2008-08-26 17:42 [Bug ada/37245] New: GDB reports "No definition of "var1" in current context." for an existing variable ludovic at ludovic-brenta dot org
@ 2008-08-26 17:44 ` ludovic at ludovic-brenta dot org
  2008-08-26 17:50 ` ludovic at ludovic-brenta dot org
  1 sibling, 0 replies; 3+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2008-08-26 17:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ludovic at ludovic-brenta dot org  2008-08-26 17:43 -------
Created an attachment (id=16151)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16151&action=view)
Source file that reproduces the problem


-- 


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/37245] GDB reports "No definition of "var1" in current context." for an existing variable
  2008-08-26 17:42 [Bug ada/37245] New: GDB reports "No definition of "var1" in current context." for an existing variable ludovic at ludovic-brenta dot org
  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
  1 sibling, 0 replies; 3+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2008-08-26 17:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ludovic at ludovic-brenta dot org  2008-08-26 17:49 -------
Note that 4.1.2 fails in a different way than 4.3.1 and trunk.


-- 

ludovic at ludovic-brenta dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.1.2 4.3.1 4.4.0
      Known to work|                            |4.2.3


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-26 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-26 17:42 [Bug ada/37245] New: GDB reports "No definition of "var1" in current context." for an existing variable ludovic at ludovic-brenta dot org
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

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).