[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
printing fortran parameter from PGI pgf77 code
From: |
Harald Koenig |
Subject: |
printing fortran parameter from PGI pgf77 code |
Date: |
Wed, 20 Oct 2004 17:26:10 +0200 |
User-agent: |
Mutt/1.5.6i |
Hi,
gdb 5.3.92 (from SuSE 9.0) and 6.1.1 (build myself) both have problems
to print parameter constants from fortran programs which have been compiled
with the pgf77 compiler version 5.1 from PGI (portland group,
http://www.pgroup.com/
test licences are available on their home page)
IFF the parameter variables are declared as "double precision".
parameters which are declared as integer or real ar displayed correctly.
PGi ships a graphical debugger "pgdgp" which can display the double precision
parameters
correctly too, so most likely the test binary itself is correct and gdb is
wrong ?!?
as an example see the attached "par.f" and the resulting binary "par.static"
(only the libpgc.so from PGI has been linked static for easy testing).
try the following commands (full output see below)
gdb par.static
b MAIN_
r
p ipar
p rpar
p dpar
pretty often, double parameters are printed as 0 (zero), but sometimes
(or with gdb-5 ?) I get someting like this
(gdb) p dpar
$4 = -nan(0xfffff8f5c28f6)
do you know what's wrong with printing PGI' fortran constants with gdb ?
thanks for any help,
Harald Koenig
-------------------------------------------------------------------------------
turtle koenig > gdb par.static
GNU gdb 6.1.1
Copyright 2004 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 "i686-pc-linux-gnu"...BFD: BFD 2.15.90 20040301
assertion fail /soft/gdb/gdb-6.1.1/gdb-6.1.1/bfd/libbfd.c:551
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) b MAIN_
BFD: BFD 2.15.90 20040301 assertion fail
/soft/gdb/gdb-6.1.1/gdb-6.1.1/bfd/libbfd.c:551
Breakpoint 1 at 0x8048e96: file par.f, line 1.
(gdb) r
Starting program: /home/koenig/par.static
Breakpoint 1, test () at par.f:11
11 print *,ipar,rpar,dpar
Current language: auto; currently fortran
(gdb) p ipar
$1 = 42
(gdb) p rpar
$2 = 42.4199982
(gdb) p dpar
$3 = 0
(gdb)
-------------------------------------------------------------------------------
PGDBG 5.1-3 x86 (Workstation, 16 CPU)
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2003, STMicroelectronics, Inc. All Rights Reserved.
***Reading DWARFv2 Information.
Loaded: /net/w0008457/fs1/home/xrsc051/par.static
pgdbg> b test
breakpoint set at: test line: 11 in "par.f" address: 0x8048e96
1
pgdbg> run
Reloading: /net/w0008457/fs1/home/xrsc051/par.static
argv[0]= /net/w0008457/fs1/home/xrsc051/par.static
libc.so.6 loaded by ld-linux.so.2.
libm.so.6 loaded by ld-linux.so.2.
Breakpoint at 0x8048e96, function test, file par.f, line 11
#11: print *,ipar,rpar,dpar
pgdbg> p ipar
42
pgdbg> p rpar
42.419998
pgdbg> p dpar
42.420000000000002
pgdbg>
-------------------------------------------------------------------------------
--
"I hope to die ___ _____
before I *have* to use Microsoft Word.", 0--,| /OOOOOOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen. <_/ / /OOOOOOOOOOO\
\ \/OOOOOOOOOOOOOOO\
\ OOOOOOOOOOOOOOOOO|//
Harald Koenig \/\/\/\/\/\/\/\/\/
science+computing ag // / \\ \
address@hidden ^^^^^ ^^^^^
par.f
Description: Text document
par.static.gz
Description: application/gunzip
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- printing fortran parameter from PGI pgf77 code,
Harald Koenig <=