diff options
author | Pierre Muller <muller@sourceware.org> | 2009-02-13 23:37:24 +0000 |
---|---|---|
committer | Pierre Muller <muller@sourceware.org> | 2009-02-13 23:37:24 +0000 |
commit | 417e16e2a0ff33881495bc45c66df23632c8d726 (patch) | |
tree | 95ff80f3b459c15a5aba1f3cc90325acbc5a03d6 /gdb/testsuite/lib | |
parent | 2ff5e6054c295e987f498887943ab1b03ae8f140 (diff) | |
download | gdb-417e16e2a0ff33881495bc45c66df23632c8d726.zip gdb-417e16e2a0ff33881495bc45c66df23632c8d726.tar.gz gdb-417e16e2a0ff33881495bc45c66df23632c8d726.tar.bz2 |
* lib/gdb.exp (get_valueof): Accept anything as a return value.
(get_integer_valueof): New procedure.
(get_sizeof): Use new get_integer_value_of.
* gdb.base/sizeof.exp: Replace all uses of get_valueof
by get_integer_valueof.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index e329b96..6df6b59 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2885,19 +2885,36 @@ proc get_valueof { fmt exp default } { set test "get valueof \"${exp}\"" set val ${default} gdb_test_multiple "print${fmt} ${exp}" "$test" { + -re "\\$\[0-9\]* = (.*)\[\r\n\]*$gdb_prompt $" { + set val $expect_out(1,string) + pass "$test ($val)" + } + timeout { + fail "$test (timeout)" + } + } + return ${val} +} + +proc get_integer_valueof { exp default } { + global gdb_prompt + + set test "get integer valueof \"${exp}\"" + set val ${default} + gdb_test_multiple "print /d ${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)" + fail "$test (timeout)" } } return ${val} } + proc get_sizeof { type default } { - return [get_valueof "/d" "sizeof (${type})" $default] + return [get_integer_valueof "sizeof (${type})" $default] } |