* 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-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
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 {} {
# 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]
# 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]
# 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]
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]
+}
+