aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2009-02-14 00:27:56 +0000
committerPierre Muller <muller@sourceware.org>2009-02-14 00:27:56 +0000
commitfaafb0471077b19764561b55cec06713cefd0c07 (patch)
tree9d3432e7aa45377f2c4b7560e9a13b269cae81e1 /gdb
parent86b1f9c56c5f48d5347c9a6adfbe72367baaf15b (diff)
downloadgdb-faafb0471077b19764561b55cec06713cefd0c07.zip
gdb-faafb0471077b19764561b55cec06713cefd0c07.tar.gz
gdb-faafb0471077b19764561b55cec06713cefd0c07.tar.bz2
* lib/gdb.exp (get_hexadecimal_valueof): New procedure.
* gdb.base/pc-fp.exp (get_valueofx): Remove. Replace calls to get_valueofx by get_hexadecimal_valueof.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/pc-fp.exp19
-rw-r--r--gdb/testsuite/lib/gdb.exp16
3 files changed, 24 insertions, 17 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 7b25d48..5b5ca26 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2009-02-14 Pierre Muller <muller@ics.u-strasbg.fr>
+ * lib/gdb.exp (get_hexadecimal_valueof): New procedure.
+ * gdb.base/pc-fp.exp (get_valueofx): Remove.
+ Replace calls to get_valueofx by get_hexadecimal_valueof.
+
+2009-02-14 Pierre Muller <muller@ics.u-strasbg.fr>
+
* lib/gdb.exp (get_valueof): Accept anything as a return value.
(get_integer_valueof): New procedure.
(get_sizeof): Use new get_integer_value_of.
diff --git a/gdb/testsuite/gdb.base/pc-fp.exp b/gdb/testsuite/gdb.base/pc-fp.exp
index 20eca4e..def406c 100644
--- a/gdb/testsuite/gdb.base/pc-fp.exp
+++ b/gdb/testsuite/gdb.base/pc-fp.exp
@@ -53,26 +53,11 @@ if ![runto_main] then {
continue
}
-proc get_valueofx { fmt exp default } {
- global gdb_prompt
- send_gdb "print${fmt} ${exp}\n"
- gdb_expect {
- -re "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" {
- set val $expect_out(1,string)
- pass "get value of ${exp}"
- }
- timeout {
- set val ${default}
- fail "get value of ${exp} (timeout)"
- }
- }
- return ${val}
-}
# Get the value of PC and FP
-set valueof_pc [get_valueofx "/x" "\$pc" "0"]
-set valueof_fp [get_valueofx "/x" "\$fp" "0"]
+set valueof_pc [get_hexadecimal_valueof "\$pc" "0"]
+set valueof_fp [get_hexadecimal_valueof "\$fp" "0"]
# Check that the sequence $REGNAME -> REGNUM -> $REGNAME works. Use
# display since that encodes and then decodes the expression parameter
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6df6b59..820ab20 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2913,6 +2913,22 @@ proc get_integer_valueof { exp default } {
return ${val}
}
+proc get_hexadecimal_valueof { exp default } {
+ global gdb_prompt
+ send_gdb "print /x ${exp}\n"
+ set test "get hexadecimal valueof \"${exp}\""
+ gdb_expect {
+ -re "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" {
+ set val $expect_out(1,string)
+ pass "$test"
+ }
+ timeout {
+ set val ${default}
+ fail "$test (timeout)"
+ }
+ }
+ return ${val}
+}
proc get_sizeof { type default } {
return [get_integer_valueof "sizeof (${type})" $default]