* [patch] Test scalar call/return/finish test - call-sc
@ 2004-04-24 0:03 Andrew Cagney
2004-04-24 18:20 ` Joel Brobecker
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2004-04-24 0:03 UTC (permalink / raw)
To: gdb-patches, Joel Brobecker, Jerome Guitton
[-- Attachment #1: Type: text/plain, Size: 489 bytes --]
Hello,
The attached does to scalars (integers, floats and enums) what
structs.exp did to structures - checks that GDB can pass, return and
finish all (well almost) possible variants.
It's named "call-*" so that it pairs up with the other function call
code. I'm thinking that "structs.exp" might deserve a similar rename
(or if someone has a better suggested grouping).
Joel, Jerome, AIX should have zero call-sc and structs failures (as
there is for PPC/elf).
committed,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 18774 bytes --]
2004-04-23 Andrew Cagney <cagney@redhat.com>
* gdb.base/call-sc.exp: New test of scalar call/return values.
* gdb.base/call-sc.c: Ditto.
Index: gdb.base/call-sc.c
===================================================================
RCS file: gdb.base/call-sc.c
diff -N gdb.base/call-sc.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb.base/call-sc.c 23 Apr 2004 23:32:32 -0000
@@ -0,0 +1,83 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+/* Useful abreviations. */
+typedef void t;
+typedef char tc;
+typedef short ts;
+typedef int ti;
+typedef long tl;
+typedef long long tll;
+typedef float tf;
+typedef double td;
+typedef long double tld;
+typedef enum { e = '1' } te;
+
+/* Force the type of each field. */
+#ifndef T
+typedef t T;
+#endif
+
+T foo = '1', L;
+
+T fun()
+{
+ return foo;
+}
+
+#ifdef PROTOTYPES
+void Fun(T foo)
+#else
+void Fun(foo)
+ T foo;
+#endif
+{
+ L = foo;
+}
+
+zed ()
+{
+ L = 'Z';
+}
+
+int main()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ int i;
+
+ Fun(foo);
+
+ /* An infinite loop that first clears all the variables and then
+ calls the function. This "hack" is to make re-testing easier -
+ "advance fun" is guaranteed to have always been preceeded by a
+ global variable clearing zed call. */
+
+ zed ();
+ while (1)
+ {
+ L = fun ();
+ zed ();
+ }
+
+ return 0;
+}
Index: gdb.base/call-sc.exp
===================================================================
RCS file: gdb.base/call-sc.exp
diff -N gdb.base/call-sc.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb.base/call-sc.exp 23 Apr 2004 23:32:32 -0000
@@ -0,0 +1,487 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test "return", "finish", and "call" of functions that a scalar (int,
+# float, enum) and/or take a single scalar parameter.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Some targets can't call functions, so don't even bother with this
+# test.
+
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*"
+ fail "This target can not call functions"
+ continue
+}
+
+set testfile "call-sc"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the
+# compiler used to compile the test case.
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# Use the file name, compiler and tuples to set up any needed KFAILs.
+
+proc setup_kfails { file tuples bug } {
+ global testfile
+ if [string match $file $testfile] {
+ foreach f $tuples { setup_kfail $f $bug }
+ }
+}
+
+proc setup_compiler_kfails { file compiler format tuples bug } {
+ global testfile
+ if {[string match $file $testfile] && [test_compiler_info $compiler] && [test_debug_format $format]} {
+ foreach f $tuples { setup_kfail $f $bug }
+ }
+}
+
+# Compile a variant of scalars.c using TYPE to specify the type of the
+# parameter and return-type. Run the compiled program up to "main".
+# Also updates the global "testfile" to reflect the most recent build.
+
+proc start_scalars_test { type } {
+ global testfile
+ global srcfile
+ global binfile
+ global objdir
+ global subdir
+ global srcdir
+ global gdb_prompt
+ global expect_out
+
+ # Create the additional flags
+ set flags "debug additional_flags=-DT=${type}"
+ set testfile "call-sc-${type}"
+
+ set binfile ${objdir}/${subdir}/${testfile}
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
+ # built the second test case since we can't use prototypes
+ warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags} additional_flags=-DNO_PROTOTYPES"] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ }
+
+ # Start with a fresh gdb.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ # Make certain that the output is consistent
+ gdb_test "set print sevenbit-strings" "" \
+ "set print sevenbit-strings; ${testfile}"
+ gdb_test "set print address off" "" \
+ "set print address off; ${testfile}"
+ gdb_test "set width 0" "" \
+ "set width 0; ${testfile}"
+
+ # Advance to main
+ if { ![runto_main] } then {
+ gdb_suppress_tests;
+ }
+
+ # Get the debug format
+ get_debug_format
+
+ # check that type matches what was passed in
+ set test "ptype; ${testfile}"
+ set foo_t "xxx"
+ gdb_test_multiple "ptype ${type}" "${test}" {
+ -re "type = (\[^\\r\\n\]*).*$gdb_prompt $" {
+ set foo_t "$expect_out(1,string)"
+ pass "$test (${foo_t})"
+ }
+ }
+ gdb_test "ptype foo" "type = ${foo_t}" "ptype foo; ${testfile} $expect_out(1,string)"
+}
+
+
+# Given N (0..25), return the corresponding alphabetic letter in lower
+# or upper case. This is ment to be i18n proof.
+
+proc i2a { n } {
+ return [string range "abcdefghijklmnopqrstuvwxyz" $n $n]
+}
+
+proc I2A { n } {
+ return [string toupper [i2a $n]]
+}
+
+
+# Use the file name, compiler and tuples to set up any needed KFAILs.
+
+proc setup_kfails { file tuples bug } {
+ global testfile
+ if [string match $file $testfile] {
+ foreach f $tuples { setup_kfail $f $bug }
+ }
+}
+
+proc setup_compiler_kfails { file compiler format tuples bug } {
+ global testfile
+ if {[string match $file $testfile] && [test_compiler_info $compiler] && [test_debug_format $format]} {
+ foreach f $tuples { setup_kfail $f $bug }
+ }
+}
+
+# Test GDB's ability to make inferior function calls to functions
+# returning (or passing) in a single scalar.
+
+# start_scalars_test() will have previously built a program with a
+# specified scalar type. To ensure robustness of the output, "p/c" is
+# used.
+
+# This tests the code paths "which return-value convention?" and
+# "extract return-value from registers" called by "infcall.c".
+
+proc test_scalar_calls { } {
+ global testfile
+ global gdb_prompt
+
+ # Check that GDB can always extract a scalar-return value from an
+ # inferior function call. Since GDB always knows the location of
+ # an inferior function call's return value these should never fail
+
+ # Implemented by calling the parameterless function "fun" and then
+ # examining the return value printed by GDB.
+
+ set tests "call ${testfile}"
+
+ # Call fun, checking the printed return-value.
+ gdb_test "p/c fun()" "= 49 '1'" "p/c fun(); ${tests}"
+
+ # Check that GDB can always pass a structure to an inferior function.
+ # This test can never fail.
+
+ # Implemented by calling the one parameter function "Fun" which
+ # stores its parameter in the global variable "L". GDB then
+ # examining that global to confirm that the value is as expected.
+
+ gdb_test "call Fun(foo)" "" "call Fun(foo); ${tests}"
+ gdb_test "p/c L" " = 49 '1'" "p/c L; ${tests}"
+}
+
+# Test GDB's ability to both return a function (with "return" or
+# "finish") and correctly extract/store any corresponding
+# return-value.
+
+# Check that GDB can consistently extract/store structure return
+# values. There are two cases - returned in registers and returned in
+# memory. For the latter case, the return value can't be found and a
+# failure is "expected". However GDB must still both return the
+# function and display the final source and line information.
+
+# N identifies the number of elements in the struct that will be used
+# for the test case. FAILS is a list of target tuples that will fail
+# this test.
+
+# This tests the code paths "which return-value convention?", "extract
+# return-value from registers", and "store return-value in registers".
+# Unlike "test struct calls", this test is expected to "fail" when the
+# return-value is in memory (GDB can't find the location). The test
+# is in three parts: test "return"; test "finish"; check that the two
+# are consistent. GDB can sometimes work for one command and not the
+# other.
+
+proc test_scalar_returns { } {
+ global gdb_prompt
+ global testfile
+
+ set tests "return ${testfile}"
+
+
+ # Check that "return" works.
+
+ # GDB must always force the return of a function that has
+ # a struct result. Dependant on the ABI, it may, or may not be
+ # possible to store the return value in a register.
+
+ # The relevant code looks like "L{n} = fun{n}()". The test forces
+ # "fun{n}" to "return" with an explicit value. Since that code
+ # snippet will store the the returned value in "L{n}" the return
+ # is tested by examining "L{n}". This assumes that the
+ # compiler implemented this as fun{n}(&L{n}) and hence that when
+ # the value isn't stored "L{n}" remains unchanged. Also check for
+ # consistency between this and the "finish" case.
+
+ # Get into a call of fun
+ gdb_test "advance fun" \
+ "fun .*\[\r\n\]+\[0-9\].*return foo.*" \
+ "advance to fun for return; ${tests}"
+
+ # Check that the program invalidated the relevant global.
+ gdb_test "p/c L" " = 90 'Z'" "zed L for return; ${tests}"
+
+ # Force the "return". This checks that the return is always
+ # performed, and that GDB correctly reported this to the user.
+ # GDB 6.0 and earlier, when the return-value's location wasn't
+ # known, both failed to print a final "source and line" and misplaced
+ # the frame ("No frame").
+
+ # The test is writen so that it only reports one FAIL/PASS for the
+ # entire operation. The value returned is checked further down.
+ # "return_value_unknown", if non-empty, records why GDB realised
+ # that it didn't know where the return value was.
+
+ set test "return foo; ${tests}"
+ set return_value_unknown 0
+ set return_value_unimplemented 0
+ setup_kfails call-sc-tld i*86-*-* gdb/1623
+ gdb_test_multiple "return foo" "${test}" {
+ -re "The location" {
+ # Ulgh, a struct return, remember this (still need prompt).
+ set return_value_unknown 1
+ exp_continue
+ }
+ -re "A structure or union" {
+ # Ulgh, a struct return, remember this (still need prompt).
+ set return_value_unknown 1
+ # Double ulgh. Architecture doesn't use return_value and
+ # hence hasn't implemented small structure return.
+ set return_value_unimplemented 1
+ exp_continue
+ }
+ -re "Make fun return now.*y or n. $" {
+ gdb_test_multiple "y" "${test}" {
+ -re "L *= fun.*${gdb_prompt} $" {
+ # Need to step off the function call
+ gdb_test "next" "zed.*" "${test}"
+ }
+ -re "L[expr + 1] *= fun[expr + 1].*${gdb_prompt} $" {
+ pass "${test}"
+ }
+ }
+ }
+ }
+
+ # Check that the return-value is as expected. At this stage we're
+ # just checking that GDB has returned a value consistent with
+ # "return_value_unknown" set above.
+
+ set test "value foo returned; ${tests}"
+ setup_kfails call-sc-tc x86_64-*-* gdb/1624
+ setup_kfails call-sc-ts x86_64-*-* gdb/1624
+ setup_kfails call-sc-ti x86_64-*-* gdb/1624
+ setup_kfails call-sc-tl x86_64-*-* gdb/1624
+ setup_kfails call-sc-tll x86_64-*-* gdb/1624
+ setup_kfails call-sc-tld x86_64-*-* gdb/1624
+ setup_kfails call-sc-te x86_64-*-* gdb/1624
+ setup_kfails call-sc-tf i*86-*-* gdb/1623
+ setup_kfails call-sc-td i*86-*-* gdb/1623
+ setup_kfails call-sc-tld i*86-*-* gdb/1623
+ gdb_test_multiple "p/c L" "${test}" {
+ -re " = 49 '1'.*${gdb_prompt} $" {
+ if $return_value_unknown {
+ # This contradicts the above claim that GDB didn't
+ # know the location of the return-value.
+ fail "${test}"
+ } else {
+ pass "${test}"
+ }
+ }
+ -re " = 90 .*${gdb_prompt} $" {
+ if $return_value_unknown {
+ # The struct return case. Since any modification
+ # would be by reference, and that can't happen, the
+ # value should be unmodified and hence Z is expected.
+ # Is this a reasonable assumption?
+ pass "${test}"
+ } else {
+ # This contradicts the above claim that GDB knew
+ # the location of the return-value.
+ fail "${test}"
+ }
+ }
+ -re ".*${gdb_prompt} $" {
+ if $return_value_unimplemented {
+ # What a suprize. The architecture hasn't implemented
+ # return_value, and hence has to fail.
+ kfail "$test" gdb/1444
+ } else {
+ fail "$test"
+ }
+ }
+ }
+
+ # Check that a "finish" works.
+
+ # This is almost but not quite the same as "call struct funcs".
+ # Architectures can have subtle differences in the two code paths.
+
+ # The relevant code snippet is "L{n} = fun{n}()". The program is
+ # advanced into a call to "fun{n}" and then that function is
+ # finished. The returned value that GDB prints, reformatted using
+ # "p/c", is checked.
+
+ # Get into "fun()".
+ gdb_test "advance fun" \
+ "fun .*\[\r\n\]+\[0-9\].*return foo.*" \
+ "advance to fun for finish; ${tests}"
+
+ # Check that the program invalidated the relevant global.
+ gdb_test "p/c L" " = 90 'Z'" "zed L for finish; ${tests}"
+
+ # Finish the function, set 'finish_value_unknown" to non-empty if the
+ # return-value was not found.
+ set test "finish foo; ${tests}"
+ set finish_value_unknown 0
+ gdb_test_multiple "finish" "${test}" {
+ -re "Value returned is .*${gdb_prompt} $" {
+ pass "${test}"
+ }
+ -re "Cannot determine contents.*${gdb_prompt} $" {
+ # Expected bad value. For the moment this is ok.
+ set finish_value_unknown 1
+ pass "${test}"
+ }
+ }
+
+ # Re-print the last (return-value) using the more robust
+ # "p/c". If no return value was found, the 'Z' from the previous
+ # check that the variable was cleared, is printed.
+ set test "value foo finished; ${tests}"
+ gdb_test_multiple "p/c" "${test}" {
+ -re " = 49 '1'\[\r\n\]+${gdb_prompt} $" {
+ if $finish_value_unknown {
+ # This contradicts the above claim that GDB didn't
+ # know the location of the return-value.
+ fail "${test}"
+ } else {
+ pass "${test}"
+ }
+ }
+ -re " = 90 'Z'\[\r\n\]+${gdb_prompt} $" {
+ # The value didn't get found. This is "expected".
+ if $finish_value_unknown {
+ pass "${test}"
+ } else {
+ # This contradicts the above claim that GDB did
+ # know the location of the return-value.
+ fail "${test}"
+ }
+ }
+ }
+
+ # Finally, check that "return" and finish" have consistent
+ # behavior.
+
+ # Since both "return" and "finish" use equivalent "which
+ # return-value convention" logic, both commands should have
+ # identical can/can-not find return-value messages.
+
+ # Note that since "call" and "finish" use common code paths, a
+ # failure here is a strong indicator of problems with "store
+ # return-value" code paths. Suggest looking at "return_value"
+ # when investigating a fix.
+
+ set test "return and finish use same convention; ${tests}"
+ if {$finish_value_unknown == $return_value_unknown} {
+ pass "${test}"
+ } else {
+ kfail gdb/1444 "${test}"
+ }
+}
+
+# ABIs pass anything >8 or >16 bytes in memory but below that things
+# randomly use register and/and structure conventions. Check all
+# possible sized char scalars in that range. But only a restricted
+# range of the other types.
+
+# NetBSD/PPC returns "unnatural" (3, 5, 6, 7) sized scalars in memory.
+
+# d10v is weird. 5/6 byte scalars go in memory. 2 or more char
+# scalars go in memory. Everything else is in a register!
+
+# Test every single char struct from 1..17 in size. This is what the
+# original "scalars" test was doing.
+
+start_scalars_test tc
+test_scalar_calls
+test_scalar_returns
+
+
+# Let the fun begin.
+
+# Assuming that any integer struct larger than 8 bytes goes in memory,
+# come up with many and varied combinations of a return struct. For
+# "struct calls" test just beyond that 8 byte boundary, for "struct
+# returns" test up to that boundary.
+
+# For floats, assumed that up to two struct elements can be stored in
+# floating point registers, regardless of their size.
+
+# The approx size of each structure it is computed assumed that tc=1,
+# ts=2, ti=4, tl=4, tll=8, tf=4, td=8, tld=16, and that all fields are
+# naturally aligned. Padding being added where needed. Note that
+# these numbers are just approx, the d10v has ti=2, a 64-bit has has
+# tl=8.
+
+# Approx size: 2, 4, ...
+start_scalars_test ts
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 4, 8, ...
+start_scalars_test ti
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 4, 8, ...
+start_scalars_test tl
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 8, 16, ...
+start_scalars_test tll
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 4, 8, ...
+start_scalars_test tf
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 8, 16, ...
+start_scalars_test td
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 16, 32, ...
+start_scalars_test tld
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 4, 8, ...
+start_scalars_test te
+test_scalar_calls
+test_scalar_returns
+
+return 0
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [patch] Test scalar call/return/finish test - call-sc
2004-04-24 0:03 [patch] Test scalar call/return/finish test - call-sc Andrew Cagney
@ 2004-04-24 18:20 ` Joel Brobecker
2004-04-25 11:44 ` Mark Kettenis
0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2004-04-24 18:20 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches, Jerome Guitton
> Joel, Jerome, AIX should have zero call-sc and structs failures (as
> there is for PPC/elf).
>
> committed,
> Andrew
> 2004-04-23 Andrew Cagney <cagney@redhat.com>
>
> * gdb.base/call-sc.exp: New test of scalar call/return values.
> * gdb.base/call-sc.c: Ditto.
I got a few failures...
=== gdb Summary ===
# of expected passes 141
# of unexpected failures 12
The following FAILs seem to be caused by a problem in the test itself rather
than GDB.
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tc cha
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-ts sho
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-ti i
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tl lo
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tll lo
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tf float
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-td double
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tld lo
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-te e
Let's look at the first one, for instance:
(gdb) ptype tc
type = char
(gdb) PASS: gdb.base/call-sc.exp: ptype; call-sc-tc (cha)
ptype foo
type = char
(gdb) FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tc cha
If I understand your call-sc.exp well, then the test gets the expected
answer for the second test from the first one. But as you see from the
PASS message, it only seems to have picked up the first 3 characters
of the output from the first query. Looks like there is something weird
going on...
The following ones seem to be bona fide problems:
FAIL: gdb.base/call-sc.exp: value foo returned; return call-sc-tc
FAIL: gdb.base/call-sc.exp: value foo returned; return call-sc-ts
p/c L
$3 = 90 'Z'
(gdb) PASS: gdb.base/call-sc.exp: zed L for return; return call-sc-tc
return foo
Make fun return now? (y or n) y
#0 main () at gdb.base/call-sc.c:78
78 L = fun ();
(gdb) next
79 zed ();
(gdb) PASS: gdb.base/call-sc.exp: return foo; return call-sc-tc
p/c L
$4 = 90 'Z'
(gdb) FAIL: gdb.base/call-sc.exp: value foo returned; return call-sc-tc
I think we expected L to be set to '1'.
And last but not least, this FAIL also seems to be a genuine problem:
FAIL: gdb.base/call-sc.exp: p/c L; call call-sc-tf
The log files contain the following output:
p/c fun()
$1 = 49 '1'
(gdb) PASS: gdb.base/call-sc.exp: p/c fun(); call call-sc-tf
call Fun(foo)
(gdb) PASS: gdb.base/call-sc.exp: call Fun(foo); call call-sc-tf
p/c L
$2 = 0 '\0'
(gdb) FAIL: gdb.base/call-sc.exp: p/c L; call call-sc-tf
The first "p/c fun()" proves that foo is correctly equal to '1', so
after Fun(foo) is called, L should be set to '1' too...
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [patch] Test scalar call/return/finish test - call-sc
2004-04-24 18:20 ` Joel Brobecker
@ 2004-04-25 11:44 ` Mark Kettenis
2004-04-25 14:27 ` Daniel Jacobowitz
2004-04-26 0:53 ` Joel Brobecker
0 siblings, 2 replies; 7+ messages in thread
From: Mark Kettenis @ 2004-04-25 11:44 UTC (permalink / raw)
To: brobecker; +Cc: cagney, gdb-patches, guitton.at.act-europe.dot.fr
Date: Sat, 24 Apr 2004 11:20:18 -0700
From: Joel Brobecker <brobecker@gnat.com>
> Joel, Jerome, AIX should have zero call-sc and structs failures (as
> there is for PPC/elf).
>
> committed,
> Andrew
> 2004-04-23 Andrew Cagney <cagney@redhat.com>
>
> * gdb.base/call-sc.exp: New test of scalar call/return values.
> * gdb.base/call-sc.c: Ditto.
The following FAILs seem to be caused by a problem in the test itself rather
than GDB.
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tc cha
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-ts sho
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-ti i
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tl lo
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tll lo
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tf float
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-td double
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-tld lo
FAIL: gdb.base/call-sc.exp: ptype foo; call-sc-te e
I agree. Seems to be a problem with the regexp that Andrew used.
Note that the types are truncated at the letter `n' ot `r'. The
attached patch works fixes these failures for me.
The following ones seem to be bona fide problems:
FAIL: gdb.base/call-sc.exp: value foo returned; return call-sc-tc
FAIL: gdb.base/call-sc.exp: value foo returned; return call-sc-ts
...
FAIL: gdb.base/call-sc.exp: p/c L; call call-sc-tf
I just checked in a patch that might fix these:
http://sources.redhat.com/ml/gdb-patches/2004-04/msg00608.html
Anyway, can anybody shoot any holes in my new regexp?
Mark
Index: testsuite/ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdb.base/call-sc.exp (start_scalars_test): Fix regular
expression that checks the return type.
Index: testsuite/gdb.base/call-sc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-sc.exp,v
retrieving revision 1.1
diff -u -p -r1.1 call-sc.exp
--- testsuite/gdb.base/call-sc.exp 23 Apr 2004 23:34:53 -0000 1.1
+++ testsuite/gdb.base/call-sc.exp 25 Apr 2004 11:39:19 -0000
@@ -115,7 +115,7 @@ proc start_scalars_test { type } {
set test "ptype; ${testfile}"
set foo_t "xxx"
gdb_test_multiple "ptype ${type}" "${test}" {
- -re "type = (\[^\\r\\n\]*).*$gdb_prompt $" {
+ -re "type = (.*)\r\n.*$gdb_prompt $" {
set foo_t "$expect_out(1,string)"
pass "$test (${foo_t})"
}
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [patch] Test scalar call/return/finish test - call-sc
2004-04-25 11:44 ` Mark Kettenis
@ 2004-04-25 14:27 ` Daniel Jacobowitz
2004-04-26 0:53 ` Joel Brobecker
1 sibling, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2004-04-25 14:27 UTC (permalink / raw)
To: gdb-patches
On Sun, Apr 25, 2004 at 01:44:36PM +0200, Mark Kettenis wrote:
> Anyway, can anybody shoot any holes in my new regexp?
> - -re "type = (\[^\\r\\n\]*).*$gdb_prompt $" {
> + -re "type = (.*)\r\n.*$gdb_prompt $" {
Should work - but I'd do this instead, if it works:
-re "type = (\[^\r\n\]*)\r\n$gdb_prompt $"
No reason to use .* unnecessarily, and this prevents an error message
from appearing after the ptype and not being caught. Our testsuite is
very bad about that.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [patch] Test scalar call/return/finish test - call-sc
2004-04-25 11:44 ` Mark Kettenis
2004-04-25 14:27 ` Daniel Jacobowitz
@ 2004-04-26 0:53 ` Joel Brobecker
2004-04-28 0:16 ` Mark Kettenis
1 sibling, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2004-04-26 0:53 UTC (permalink / raw)
To: Mark Kettenis; +Cc: cagney, gdb-patches, guitton.at.act-europe.dot.fr
> The following ones seem to be bona fide problems:
>
> FAIL: gdb.base/call-sc.exp: value foo returned; return call-sc-tc
> FAIL: gdb.base/call-sc.exp: value foo returned; return call-sc-ts
> ...
> FAIL: gdb.base/call-sc.exp: p/c L; call call-sc-tf
>
> I just checked in a patch that might fix these:
I just checked, and unfortunately the failures are still there :-/
> Anyway, can anybody shoot any holes in my new regexp?
I did try Daniel's suggestion, and it worked too.
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] Test scalar call/return/finish test - call-sc
2004-04-26 0:53 ` Joel Brobecker
@ 2004-04-28 0:16 ` Mark Kettenis
2004-04-28 15:49 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Mark Kettenis @ 2004-04-28 0:16 UTC (permalink / raw)
To: brobecker; +Cc: cagney, gdb-patches
Date: Sun, 25 Apr 2004 17:53:49 -0700
From: Joel Brobecker <brobecker@gnat.com>
> Anyway, can anybody shoot any holes in my new regexp?
I did try Daniel's suggestion, and it worked too.
Works for me too, so I checked in the attached.
Mark
Index: testsuite/ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdb.base/call-sc.exp (start_scalars_test): Fix regular
expression that checks the return type.
Index: testsuite/gdb.base/call-sc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-sc.exp,v
retrieving revision 1.1
diff -u -p -r1.1 call-sc.exp
--- testsuite/gdb.base/call-sc.exp 23 Apr 2004 23:34:53 -0000 1.1
+++ testsuite/gdb.base/call-sc.exp 28 Apr 2004 00:14:05 -0000
@@ -115,7 +115,7 @@ proc start_scalars_test { type } {
set test "ptype; ${testfile}"
set foo_t "xxx"
gdb_test_multiple "ptype ${type}" "${test}" {
- -re "type = (\[^\\r\\n\]*).*$gdb_prompt $" {
+ -re "type = (\[^\r\n\]*)\r\n$gdb_prompt $" {
set foo_t "$expect_out(1,string)"
pass "$test (${foo_t})"
}
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [patch] Test scalar call/return/finish test - call-sc
2004-04-28 0:16 ` Mark Kettenis
@ 2004-04-28 15:49 ` Andrew Cagney
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2004-04-28 15:49 UTC (permalink / raw)
To: Mark Kettenis; +Cc: brobecker, gdb-patches
> Date: Sun, 25 Apr 2004 17:53:49 -0700
> From: Joel Brobecker <brobecker@gnat.com>
>
> > Anyway, can anybody shoot any holes in my new regexp?
>
> I did try Daniel's suggestion, and it worked too.
>
> Works for me too, so I checked in the attached.
Thanks.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-04-28 15:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-24 0:03 [patch] Test scalar call/return/finish test - call-sc Andrew Cagney
2004-04-24 18:20 ` Joel Brobecker
2004-04-25 11:44 ` Mark Kettenis
2004-04-25 14:27 ` Daniel Jacobowitz
2004-04-26 0:53 ` Joel Brobecker
2004-04-28 0:16 ` Mark Kettenis
2004-04-28 15:49 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox