This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: tdep/1444
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 14 May 2004 18:58:00 -0000
- Subject: Re: tdep/1444
- Reply-to: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
The following reply was made to PR tdep/1444; it has been noted by GNATS.
From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: cagney@redhat.com, gdb-gnats@sources.redhat.com
Cc:
Subject: Re: tdep/1444
Date: Fri, 14 May 2004 14:54:58 -0400 (EDT)
I am getting KFAIL/1444 in gdb HEAD.
This happened sometime between gdb HEAD 2004-05-03 13:01:38 UTC
and gdb HEAD 2004-05-10 00:22:49 UTC. It happened on native
i686-pc-linux-gnu with all gcc's and debug formats. If you want
a specific configuration, try gcc 3.3.3, binutils 2.14,
and dwarf-2.
Here are some log excerpts (from gcc 2.95.3 binutils 2.14 dwarf-2):
Old gdb:
# gdb HEAD 2004-05-03 13:01:38 UTC
# gcc 2.95.3, binutils 2.14, dwarf-2
(gdb) PASS: gdb.base/structs.exp: advance to fun<n> for return; return 1 structs-tc
p/c L1
$35 = {a = 90 'Z'}
(gdb) PASS: gdb.base/structs.exp: zed L<n> for return; return 1 structs-tc
return foo1
The location at which to store the function's return value is unknown.
If you continue, the return value that you specified will be ignored.
Make fun1 return now? (y or n) y
#0 main () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/structs.c:438
438 L1 = fun1();
(gdb) next
439 L2 = fun2();
(gdb) PASS: gdb.base/structs.exp: return foo<n>; return 1 structs-tc
p/c L1
$36 = {a = 90 'Z'}
(gdb) PASS: gdb.base/structs.exp: value foo<n> returned; return 1 structs-tc
advance fun1
fun1 () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/structs.c:129
129 return foo1;
(gdb) PASS: gdb.base/structs.exp: advance to fun<n> for finish; return 1 structs-tc
p/c L1
$37 = {a = 90 'Z'}
(gdb) PASS: gdb.base/structs.exp: zed L<n> for finish; return 1 structs-tc
finish
Run till exit from #0 fun1 () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/structs.c:129
main () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/structs.c:438
438 L1 = fun1();
Value returned has type: . Cannot determine contents
(gdb) PASS: gdb.base/structs.exp: finish foo<n>; return 1 structs-tc
p/c
$38 = {a = 90 'Z'}
(gdb) PASS: gdb.base/structs.exp: value foo<n> finished; return 1 structs-tc
PASS: gdb.base/structs.exp: return and finish use same convention; return 1 structs-tc
New gdb:
# gdb HEAD 2004-05-10 00:22:49 UTC
# gcc 2.95.3, binutils 2.14, dwarf-2
(gdb) PASS: gdb.base/structs.exp: advance to fun<n> for return; return 1 structs-tc
p/c L1
$35 = {a = 90 'Z'}
(gdb) PASS: gdb.base/structs.exp: zed L<n> for return; return 1 structs-tc
return foo1
The location at which to store the function's return value is unknown.
If you continue, the return value that you specified will be ignored.
Make fun1 return now? (y or n) y
#0 main () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/structs.c:438
438 L1 = fun1();
(gdb) next
439 L2 = fun2();
(gdb) PASS: gdb.base/structs.exp: return foo<n>; return 1 structs-tc
p/c L1
$36 = {a = 90 'Z'}
(gdb) PASS: gdb.base/structs.exp: value foo<n> returned; return 1 structs-tc
advance fun1
fun1 () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/structs.c:129
129 return foo1;
(gdb) PASS: gdb.base/structs.exp: advance to fun<n> for finish; return 1 structs-tc
p/c L1
$37 = {a = 90 'Z'}
(gdb) PASS: gdb.base/structs.exp: zed L<n> for finish; return 1 structs-tc
finish
Run till exit from #0 fun1 () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/structs.c:129
main () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/structs.c:438
438 L1 = fun1();
Value returned is $38 = {a = 49 '1'}
(gdb) PASS: gdb.base/structs.exp: finish foo<n>; return 1 structs-tc
p/c
$39 = {a = 49 '1'}
(gdb) PASS: gdb.base/structs.exp: value foo<n> finished; return 1 structs-tc
KFAIL: gdb.base/structs.exp: return and finish use same convention; return 1 structs-tc (PRMS: gdb/1444)
With the old gdb, both "return" and "finish" do not return values,
so the "return and finish use same convention" test results in PASS.
With the new gdb, "return" does not return a value, but "finish"
returns the correct value. This is actually an improvement in gdb
but it breaks the "return and finish use same convention" tests.
Question: is this a real regression compared to the old behavior, or not?
Even if it's not a real regression, the comments near this test in
structs.exp indicate that gdb has a bug in it.