Bug 20112 - gdb will not print subroutine arguments
Summary: gdb will not print subroutine arguments
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-debug
: 20113 (view as bug list)
Depends on:
Blocks: 24546
  Show dependency treegraph
 
Reported: 2005-02-20 19:30 UTC by Dale Ranta
Modified: 2008-08-21 21:42 UTC (History)
1 user (show)

See Also:
Host: powerpc-apple-darwin7.8.0
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-01-29 17:56:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dale Ranta 2005-02-20 19:30:40 UTC
Sorry guys - I don't know if any of this should work, but I tried to use gdb
with limited success - if the subroutine argument values would have printed, gdb
would have been working well enough to be useful.

[dir:~/tests/gfortran] dir% gfortran  -g -o debug debug.f
[dir:~/tests/gfortran] dir% gdb debug
GNU gdb 5.3-20030128 (Apple version gdb-330.1) (Fri Jul 16 21:42:28 GMT 2004)
Copyright 2003 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 "powerpc-apple-darwin".
Reading symbols for shared libraries ..... done
(gdb) break sub1_
Breakpoint 1 at 0x1c90: file ../../../gcc/libgfortran/runtime/error.c, line 275.
(gdb) break sub1
Function "sub1" not defined.
(gdb) run
Starting program: /Users/dir/tests/gfortran/debug 
Reading symbols for shared libraries ++. done
Error in re-setting breakpoint 1:
Function "sub1_" not defined.
Re-enabling shared library breakpoints: 1

Breakpoint 1, 0x00001c90 in sub1_ (a=Invalid F77 type code 17 in symbol table.
) at debug.f:5
5             subroutine sub1(a,b)
(gdb) s
Current language:  auto; currently fortran
sub1_ (a=Invalid F77 type code 17 in symbol table.
) at debug.f:6
6             i=3
(gdb) s
7             write(*,*)a,b
(gdb) print a
$1 = (Invalid type code (17) in symbol table.
(gdb) print b
$2 = (Invalid type code (17) in symbol table.
(gdb) quit
The program is running.  Exit anyway? (y or n) y
[dir:~/tests/gfortran] dir% cat debug.f
      program main
      call sub1(1.0,2.0)
      stop
      end
      subroutine sub1(a,b)
      i=3
      write(*,*)a,b
      return
      end
Comment 1 Andrew Pinski 2005-02-20 19:34:21 UTC
Can you try -gfull?  Darwin defaults to -gused and this might be a bug of -gused.
Comment 2 Andrew Pinski 2005-02-20 19:41:09 UTC
*** Bug 20113 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Pinski 2005-02-20 19:45:28 UTC
Confirmed, Hmm, the stabs looks right:
        .stabs  "int1:t(0,17)=@s8;r(0,17);-128;127;",128,0,0,0
Maybe this is a gdb problem in that version of gdb.

This works correctly on x86-linux-gnu with -gstabs and gdb 6.3.50_2004-11-04-cvs.
Comment 4 Tobias Burnus 2008-08-21 21:26:59 UTC
Is this still an issue nowadays?
Comment 5 Andrew Pinski 2008-08-21 21:42:45 UTC
This works for i668-darwin with the trunk:
(gdb) p a
$1 = (REF TO -> ( real*4 )) @0x2004: 1
Current language:  auto; currently fortran
(gdb) p b
$2 = (REF TO -> ( real*4 )) @0x2000: 2

GNU gdb 6.3.50-20050815 (Apple version gdb-694) (Tue Jul 17 08:01:07 GMT 2007)

This has been fixed via gdb.