Article View: gnu.gdb.bug
Article #10033(none)
From: nixpbe!uucp
Date: Tue, 16 Oct 1990 21:41
Date: Tue, 16 Oct 1990 21:41
59 lines
2801 bytes
2801 bytes
>From uucp Wed Oct 17 04:56 SIN 1990 remote from nixsin
To: nixpbe!unido!gnu-gdb-bug
Path: nixsin!nixpbe!unido!mcsun!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!twinsun.com!eggert
From: eggert@twinsun.com (Paul Eggert)
Newsgroups: gnu.gdb.bug
Subject: GDB 3.5 reports wrong value for functions yielding char (on sparcs)
Message-ID: <9010030122.AA13117@ata.twinsun.com>
Date: 3 Oct 90 01:22:45 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 44
Posted: Wed Oct 3 02:22:45 1990
When a function yields a value of type 'char', GDB 3.5 doesn't display the
returned value correctly (with GCC 1.37.1, GAS 1.36, Sparcstation 1+, SunOS
4.1). Here is an example:
213-ata% cat t.c
char p() { return 1; }
main() { return p(); }
214-ata% gcc -g -v t.c
gcc version 1.37.1
/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix -D__sparc__ -D__su
n__ -D__unix__ t.c /usr/tmp/cca13099.cpp
GNU CPP version 1.37.1
/local/lib/gcc-cc1 /usr/tmp/cca13099.cpp -quiet -dumpbase t.c -g -version -o /u
sr/tmp/cca13099.s
GNU C version 1.37.1 (sparc) compiled by GNU C version 1.37.1.
default target switches: -mfpu -mepilogue
/local/lib/gcc-as -o t.o /usr/tmp/cca13099.s
ld -e start -dc -dp -Bstatic /lib/crt0.o t.o /local/lib/gcc-gnulib -lg -lc /loc
al/lib/gcc-gnulib
215-ata% gdb a.out
GDB 3.5, Copyright (C) 1989 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /tmp/a.out...done.
Type "help" for a list of commands.
(gdb) b p
Reading in symbols for t.c...done.
Breakpoint 1 at 0x2294: file t.c, line 1.
(gdb) r
Starting program: /tmp/a.out
Bpt 1, p () (t.c line 1)
1 char p() { return 1; }
(gdb) finish
Run till exit from #0 p () (t.c line 1)
0x22bc in main () (t.c line 2)
2 main() { return p(); }
Value returned is $1 = 0 '\000'
The value returned is actually 1, but GDB displays it as 0 in the last line of
the output above.
Technical Details
Message-ID:
<9010162141.AW24254@unido.informatik.uni-dortmund.de>Path:
arc1-ca.pugleaf.net!gmdzi!unido!isaak!escher!nadia!smurf!ira.uka.de!sol.ctr.columbia.edu!cica!tut.cis.ohio-state.edu!relay.eu.net!nixpbe!uucpShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,c313bf9b7e840c49 X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 1990-10-16 14:41:02 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!isaak!escher!nadia!smurf!ira.uka.de!sol.ctr.columbia.edu!cica!tut.cis.ohio-state.edu!relay.eu.net!nixpbe!uucp From: nixpbe!uucp@relay.eu.net Newsgroups: gnu.gdb.bug Subject: (none) Message-ID: <9010162141.AW24254@unido.informatik.uni-dortmund.de> Date: 16 Oct 90 21:41:02 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 59 Approved: bug-gdb@prep.ai.mit.edu Posted: Tue Oct 16 22:41:02 1990