diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/dfp-test.exp | 20 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/long_long.exp | 20 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/remote.exp | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/sizeof.exp | 18 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 23 |
6 files changed, 32 insertions, 74 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 93971001c5f..d2a473c0b42 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 32f36a9f0ad..94fcb417664 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 e58539690bf..d0ad5bacedc 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 0dee13a51db..113c56b7aa4 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 61a6be3c055..82f0da2774e 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 b0059b7576e..e329b96e1af 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] +} + |