public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/24790]  New: arguments are displayed as reference or pointer to normal type in GDB
@ 2005-11-11  9:09 woodzltc at sources dot redhat dot com
  2005-11-11 15:22 ` [Bug fortran/24790] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: woodzltc at sources dot redhat dot com @ 2005-11-11  9:09 UTC (permalink / raw)
  To: gcc-bugs

Here is a testcase:

fmain.f:
=========
        dimension a(10)
        call sub(a,10)
fsub.f:
=========
        subroutine sub(a,n)
        dimension a(n)
        do i = 1, n
          a(i) = sqr(i)
        end do
        return
        end subroutine

        function sqr(m)
          sqr = m * m
        end function


build a binary:
# gfortran -g -o fbase fmain.f fsub.f
# gdb -q ./fbase
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) b sub_
Breakpoint 1 at 0x804876b: file fsub.f, line 21.
(gdb) b sqr_
Breakpoint 2 at 0x80487c1: file fsub.f, line 30.
(gdb) r
Starting program: /root/DE/gdb-6.4/src/gdb/testsuite/gdb.fortran/fbase
 Test begin.

Breakpoint 1, sub_ (a=0xbff5cf30, n=@0x8048918) at fsub.f:21
21              do i = 1, n
Current language:  auto; currently fortran
(gdb) p a
$1 = (PTR TO -> ( real*4 (0:-1))) 0xbff5cf30
(gdb) p n
$2 = (REF TO -> ( int4 )) @0x8048918: 10
(gdb) c
Continuing.

Breakpoint 2, sqr_ (m=@0xbff5cf00) at fsub.f:30
30                tmp1 = m
(gdb) p m
$3 = (REF TO -> ( int4 )) @0xbff5cf00: 1
(gdb)

In the above debugging session, argument 'a' of sub is displayed as pointer of
the normal type, 'n' of sub and 'm' of sqr are displayed as reference to normal
type.


-- 
           Summary: arguments are displayed as reference or pointer to
                    normal type in GDB
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: woodzltc at sources dot redhat dot com


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


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

* [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
@ 2005-11-11 15:22 ` pinskia at gcc dot gnu dot org
  2005-11-15  2:26 ` woodzltc at sources dot redhat dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-11 15:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-11 15:22 -------
Confirmed, 
DECL_ARG_TYPE should be the reference type and the DECL_TYPE should be the
normal type.

This might also fix the implicate bug too (I forgot the number).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-11 15:22:23
               date|                            |


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


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

* [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
  2005-11-11 15:22 ` [Bug fortran/24790] " pinskia at gcc dot gnu dot org
@ 2005-11-15  2:26 ` woodzltc at sources dot redhat dot com
  2005-11-15  3:17   ` Andrew Pinski
  2005-11-15  3:17 ` pinskia at physics dot uc dot edu
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: woodzltc at sources dot redhat dot com @ 2005-11-15  2:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from woodzltc at sources dot redhat dot com  2005-11-15 02:26 -------
Hi Andrew,

(In reply to comment #1)
> Confirmed, 
> DECL_ARG_TYPE should be the reference type and the DECL_TYPE should be the
> normal type.
> 
> This might also fix the implicate bug too (I forgot the number).

Do you means that you already had a fix for this?  If so, would you please
point me to a link of that patch?  I am very keen to see how this is fixed. I
believe that I can learn something from your patch.  Thanks.


-- 


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


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

* [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
  2005-11-11 15:22 ` [Bug fortran/24790] " pinskia at gcc dot gnu dot org
  2005-11-15  2:26 ` woodzltc at sources dot redhat dot com
@ 2005-11-15  3:17 ` pinskia at physics dot uc dot edu
  2005-12-06  2:12 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: pinskia at physics dot uc dot edu @ 2005-11-15  3:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2005-11-15 03:17 -------
Subject: Re:  arguments are displayed as reference or pointer to normal type in
GDB

> 
> 
> 
> ------- Comment #2 from woodzltc at sources dot redhat dot com  2005-11-15 02:26 -------
> Hi Andrew,
> 
> (In reply to comment #1)
> > Confirmed, 
> > DECL_ARG_TYPE should be the reference type and the DECL_TYPE should be the
> > normal type.
> > 
> > This might also fix the implicate bug too (I forgot the number).
> 
> Do you means that you already had a fix for this?  If so, would you please
> point me to a link of that patch?  I am very keen to see how this is fixed. I
> believe that I can learn something from your patch.  Thanks.


No, just an idea on how to fix it and how the C++ represents some of its
arguments
which are passed via a reference.

-- Pinski


-- 


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


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

* Re: [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-15  2:26 ` woodzltc at sources dot redhat dot com
@ 2005-11-15  3:17   ` Andrew Pinski
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Pinski @ 2005-11-15  3:17 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

> 
> 
> 
> ------- Comment #2 from woodzltc at sources dot redhat dot com  2005-11-15 02:26 -------
> Hi Andrew,
> 
> (In reply to comment #1)
> > Confirmed, 
> > DECL_ARG_TYPE should be the reference type and the DECL_TYPE should be the
> > normal type.
> > 
> > This might also fix the implicate bug too (I forgot the number).
> 
> Do you means that you already had a fix for this?  If so, would you please
> point me to a link of that patch?  I am very keen to see how this is fixed. I
> believe that I can learn something from your patch.  Thanks.


No, just an idea on how to fix it and how the C++ represents some of its arguments
which are passed via a reference.

-- Pinski


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

* [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
                   ` (2 preceding siblings ...)
  2005-11-15  3:17 ` pinskia at physics dot uc dot edu
@ 2005-12-06  2:12 ` pinskia at gcc dot gnu dot org
  2006-01-17 16:48 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-06  2:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2005-12-06 02:12 -------
Some of it can be fixed by using:
/* In a RESULT_DECL or PARM_DECL, means that it is passed by invisible
   reference (and the TREE_TYPE is a pointer to the true type).  */
#define DECL_BY_REFERENCE(NODE) (DECL_COMMON_CHECK (NODE)->common.private_flag)


-- 


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


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

* [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
                   ` (3 preceding siblings ...)
  2005-12-06  2:12 ` pinskia at gcc dot gnu dot org
@ 2006-01-17 16:48 ` pinskia at gcc dot gnu dot org
  2006-10-22 21:03 ` burnus at net-b dot de
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-17 16:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-01-17 16:48 -------
I don't have time for this bug at least right now.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|pinskia at gcc dot gnu dot  |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
                   ` (4 preceding siblings ...)
  2006-01-17 16:48 ` pinskia at gcc dot gnu dot org
@ 2006-10-22 21:03 ` burnus at net-b dot de
  2008-08-29 18:50 ` jakub at gcc dot gnu dot org
  2009-04-04 18:13 ` dfranke at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: burnus at net-b dot de @ 2006-10-22 21:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at net-b dot de  2006-10-22 21:03 -------
See http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01086.html for a preliminary
patch.


-- 


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


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

* [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
                   ` (5 preceding siblings ...)
  2006-10-22 21:03 ` burnus at net-b dot de
@ 2008-08-29 18:50 ` jakub at gcc dot gnu dot org
  2009-04-04 18:13 ` dfranke at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-08-29 18:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2008-08-29 18:48 -------
Subject: Bug 24790

Author: jakub
Date: Fri Aug 29 18:47:19 2008
New Revision: 139777

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139777
Log:
        PR fortran/24790
        * trans-decl.c (create_function_arglist): Set DECL_BY_REFERENCE on
        PARM_DECLs with pointer or reference type.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-decl.c


-- 


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


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

* [Bug fortran/24790] arguments are displayed as reference or pointer to normal type in GDB
  2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
                   ` (6 preceding siblings ...)
  2008-08-29 18:50 ` jakub at gcc dot gnu dot org
@ 2009-04-04 18:13 ` dfranke at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-04-04 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dfranke at gcc dot gnu dot org  2009-04-04 18:12 -------
The session from the report now looks like:

$ gfortran-svn -g pr24790.f
daniel@silence ~/pr $ gdb -q a.out
(gdb) break sub_
Breakpoint 1 at 0x804855c: file pr24790.f, line 5.
(gdb) break sqr_
Breakpoint 2 at 0x80485eb: file pr24790.f, line 13.
(gdb) run
Starting program: /home/daniel/pr/a.out

Breakpoint 1, sub (a=(), n=10) at pr24790.f:5
5               subroutine sub(a,n)
(gdb) p a
$1 = ()
(gdb) p n
$2 = 10
(gdb) cont
Continuing.

Breakpoint 2, sqr (m=1) at pr24790.f:14
14                sqr = m * m
(gdb) p m
$3 = 1


Closing as fixed. Thanks, Jakub!


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
             Status|NEW                         |RESOLVED
      Known to fail|                            |4.3.3
      Known to work|                            |4.5.0
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.0


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


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

end of thread, other threads:[~2009-04-04 18:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-11  9:09 [Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB woodzltc at sources dot redhat dot com
2005-11-11 15:22 ` [Bug fortran/24790] " pinskia at gcc dot gnu dot org
2005-11-15  2:26 ` woodzltc at sources dot redhat dot com
2005-11-15  3:17   ` Andrew Pinski
2005-11-15  3:17 ` pinskia at physics dot uc dot edu
2005-12-06  2:12 ` pinskia at gcc dot gnu dot org
2006-01-17 16:48 ` pinskia at gcc dot gnu dot org
2006-10-22 21:03 ` burnus at net-b dot de
2008-08-29 18:50 ` jakub at gcc dot gnu dot org
2009-04-04 18:13 ` dfranke at gcc dot gnu 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).