2004-07-13 Andrew Cagney <cagney@gnu.org>
+ * gdb.base/sizeof.exp: Skip test when no inferior I/O.
+ (check_sizeof, check_valueof): Do not include the output in the
+ test name. Use gdb_test.
+ (get_valueof): Use gdb_test_multiple.
+
* gdb.base/step-test.exp: Update copyright. Use
gdb_test_multiple. Ensure that test names do not include
architecture dependent output.
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+if [target_info exists gdb,noinferiorio] {
+ verbose "Skipping fileio.exp because of no fileio capabilities."
+ continue
+}
+
if $tracelevel {
strace $tracelevel
}
proc get_valueof { fmt exp default } {
global gdb_prompt
- send_gdb "print${fmt} ${exp}\n"
- gdb_expect {
+
+ set test "get valueof \"${exp}\""
+ set val ${default}
+ gdb_test_multiple "print${fmt} ${exp}" "$test" {
-re "\\$\[0-9\]* = (\[-\]*\[0-9\]*).*$gdb_prompt $" {
set val $expect_out(1,string)
- pass "get value of ${exp} ($val)"
- }
- timeout {
- set size ${default}
- fail "get value of ${exp} (timeout)"
+ pass "$test ($val)"
}
}
return ${val}
proc check_sizeof { type size } {
global gdb_prompt
- if [gdb_skip_stdio_test "check sizeof $type == $size"] {
- return;
- }
-
set pat [string_to_regexp "sizeof (${type}) == ${size}"]
- set test "check sizeof ${type}"
- gdb_test_multiple "next" "$test" {
- -re "${pat}\[\r\n\].*$gdb_prompt $" {
- pass "$test"
- }
- }
+ gdb_test "next" "${pat}\[\r\n\]+\[0-9\].*" "check sizeof \"$type\""
}
check_sizeof "char" ${sizeof_char}
proc check_valueof { exp val } {
global gdb_prompt
- if [gdb_skip_stdio_test "check valueof $exp == $val"] {
- return;
- }
-
set pat [string_to_regexp "valueof (${exp}) == ${val}"]
- send_gdb "next\n"
- gdb_expect {
- -re "${pat}\[\r\n\].*$gdb_prompt $" {
- pass "check valueof ${exp} == ${val}"
- }
- -re ".*$gdb_prompt $" {
- fail "check valueof ${exp} == ${val}"
- }
- timeout {
- fail "check valueof ${exp} == ${val} (timeout)"
- }
- }
+ gdb_test "next" "${pat}\[\r\n\]+\[0-9\].*" "check valueof \"$exp\""
}
# Check that GDB and the target agree over the sign of a character.