This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/testsuite] call-sc.exp: fix glitch in "return foo;"
- From: Michael Chastain <mec dot gnu at mindspring dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: pgilliam at us dot ibm dot com, cagney at redhat dot com
- Date: Fri, 20 Aug 2004 06:56:19 -0400
- Subject: [patch/testsuite] call-sc.exp: fix glitch in "return foo;"
This patch fixes a cut-and-paste glitch in call-sc.exp.
The original C code in structs.c was:
zed ();
L1 = fun1();
L2 = fun2();
L3 = fun3();
structs.exp has some code which says: when gdb returns from
"L${n} = fun${n}", if the current line is "L${n+1} = fun${n+1}",
then PASS.
That code got copied into call-sc.exp, but it doesn't work in
call-sc.exp, because the C code in call-sc.c is different:
L = fun ();
zed ();
The fix is trivial.
This would manifest as a FAIL if the C compiler generated code
for "L = fun ();" where the last assembly instruction for the line
is the assembly language CALL instruction. That might happen if
"fun()" does structure returns with a hidden argument for the
address of the structure. I don't think this would screw up the
control flow, just manifest as a single FAIL.
I looked for some gdb.sum/gdb.log files where this actually happens,
but I didn't find anyway. I checked:
native i686-pc-linux-gnu with a bunch of gcc versions
native hppa2.0w-hp-hpux11.11 with hpux ansi c
native powerpc-ibm-aix5.1.0.0 with gcc
Tested on native i686-pc-linux-gnu with gcc 2.95.3, gcc 3.3.4,
gcc 3.4.1, dwarf-2 and stabs+.
I am committing this now.
===
2004-08-20 Michael Chastain <mec.gnu@mindspring.com>
* gdb.base/call-sc.exp (test_scalar_returns):
Fix cut-and-paste glitch in "Make fun return now".
Index: gdb.base/call-sc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-sc.exp,v
retrieving revision 1.4
diff -c -3 -p -r1.4 call-sc.exp
*** gdb.base/call-sc.exp 28 Apr 2004 18:16:07 -0000 1.4
--- gdb.base/call-sc.exp 20 Aug 2004 10:44:08 -0000
*************** proc test_scalar_returns { } {
*** 274,280 ****
# Need to step off the function call
gdb_test "next" "zed.*" "${test}"
}
! -re "L[expr + 1] *= fun[expr + 1].*${gdb_prompt} $" {
pass "${test}"
}
}
--- 274,280 ----
# Need to step off the function call
gdb_test "next" "zed.*" "${test}"
}
! -re "zed \\(\\);.*$gdb_prompt $" {
pass "${test}"
}
}