aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-02-13 16:13:47 +0000
committerTom Tromey <tromey@redhat.com>2009-02-13 16:13:47 +0000
commit7065b901d547c516370affe96e0162bb82926cc7 (patch)
tree9a9f683d24fc7f289009bd603dfb1b6ebbf5cc4e
parent0eb6d79470d4600115cfca4fe0c0a202f21ecc6d (diff)
downloadgdb-7065b901d547c516370affe96e0162bb82926cc7.zip
gdb-7065b901d547c516370affe96e0162bb82926cc7.tar.gz
gdb-7065b901d547c516370affe96e0162bb82926cc7.tar.bz2
* gdb.base/remote.exp (get_sizeof): Remove.
* gdb.base/long_long.exp (get_valueof, get_sizeof): Remove. * gdb.base/dfp-test.exp (get_valueof, get_sizeof): Remove. * gdb.base/sizeof.exp (get_valueof, get_sizeof): Remove. * lib/gdb.exp (get_valueof): Move from long_long.exp. (get_sizeof): Likewise.
-rw-r--r--gdb/testsuite/ChangeLog9
-rw-r--r--gdb/testsuite/gdb.base/dfp-test.exp20
-rw-r--r--gdb/testsuite/gdb.base/long_long.exp20
-rw-r--r--gdb/testsuite/gdb.base/remote.exp16
-rw-r--r--gdb/testsuite/gdb.base/sizeof.exp18
-rw-r--r--gdb/testsuite/lib/gdb.exp23
6 files changed, 32 insertions, 74 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 9397100..d2a473c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2009-02-13 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/remote.exp (get_sizeof): Remove.
+ * gdb.base/long_long.exp (get_valueof, get_sizeof): Remove.
+ * gdb.base/dfp-test.exp (get_valueof, get_sizeof): Remove.
+ * gdb.base/sizeof.exp (get_valueof, get_sizeof): Remove.
+ * lib/gdb.exp (get_valueof): Move from long_long.exp.
+ (get_sizeof): Likewise.
+
2009-02-12 Jan Kratochvil <jan.kratochvil@redhat.com>
PR fortran/9806
diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
index 32f36a9..94fcb41 100644
--- a/gdb/testsuite/gdb.base/dfp-test.exp
+++ b/gdb/testsuite/gdb.base/dfp-test.exp
@@ -43,26 +43,6 @@ if ![runto_main] then {
continue
}
-# Detect the size of the target's basic types (from gdb.base/long_long.exp).
-
-proc get_valueof { fmt exp default } {
- global gdb_prompt
- send_gdb "print${fmt} ${exp}\n"
- gdb_expect {
- -re "\\$\[0-9\]* = (\[-\]*\[0-9\]*).*$gdb_prompt $" {
- set val $expect_out(1,string)
- }
- timeout {
- set val ${default}
- }
- }
- return ${val}
-}
-
-proc get_sizeof { type default } {
- return [get_valueof "/d" "sizeof (${type})" $default]
-}
-
set sizeof_long [get_sizeof "long" 4]
proc d32_set_tests {} {
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index e585396..d0ad5ba 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -74,26 +74,6 @@ gdb_expect {
# Detect the size of the target's basic types.
-proc get_valueof { fmt exp default } {
- global gdb_prompt
- send_gdb "print${fmt} ${exp}\n"
- gdb_expect {
- -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)"
- }
- }
- return ${val}
-}
-
-proc get_sizeof { type default } {
- return [get_valueof "/d" "sizeof (${type})" $default]
-}
-
set sizeof_char [get_sizeof "char" 1]
set sizeof_short [get_sizeof "short" 2]
set sizeof_int [get_sizeof "int" 4]
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp
index 0dee13a..113c56b 100644
--- a/gdb/testsuite/gdb.base/remote.exp
+++ b/gdb/testsuite/gdb.base/remote.exp
@@ -125,22 +125,6 @@ gdb_load_timed $binfile "limit" 0
# Query GDB for the size of various types
#
-proc get_sizeof { type default } {
- global gdb_prompt
- send_gdb "print/d sizeof (${type})\n"
- gdb_expect {
- -re "\\$\[0-9\]* = (\[0-9\]*).*$gdb_prompt $" {
- set size $expect_out(1,string)
- pass "get sizeof ${type} ($size)"
- }
- timeout {
- set size ${default}
- fail "get sizeof ${type} (timeout)"
- }
- }
- return ${size}
-}
-
# Get the size of random_data table (defaults to 48K).
set sizeof_random_data [get_sizeof "random_data" 48*1024]
diff --git a/gdb/testsuite/gdb.base/sizeof.exp b/gdb/testsuite/gdb.base/sizeof.exp
index 61a6be3..82f0da2 100644
--- a/gdb/testsuite/gdb.base/sizeof.exp
+++ b/gdb/testsuite/gdb.base/sizeof.exp
@@ -61,24 +61,6 @@ if ![runto_main] then {
# Query GDB for the size of various types
#
-proc get_valueof { fmt exp default } {
- global gdb_prompt
-
- 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 "$test ($val)"
- }
- }
- return ${val}
-}
-
-proc get_sizeof { type default } {
- return [get_valueof "/d" "sizeof (${type})" $default]
-}
-
gdb_test "next"
set sizeof_char [get_sizeof "char" 1]
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index b0059b7..e329b96 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2878,3 +2878,26 @@ proc prepare_for_testing { testname executable {sources ""} {options {debug}}} {
return 0
}
+
+proc get_valueof { fmt exp default } {
+ global gdb_prompt
+
+ 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 "$test ($val)"
+ }
+ timeout {
+ set size ${default}
+ fail "get value of ${exp} (timeout)"
+ }
+ }
+ return ${val}
+}
+
+proc get_sizeof { type default } {
+ return [get_valueof "/d" "sizeof (${type})" $default]
+}
+