PR gdb/12659:
authorTom Tromey <tromey@redhat.com>
Wed, 15 Feb 2012 19:13:14 +0000 (19:13 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 15 Feb 2012 19:13:14 +0000 (19:13 +0000)
* infcmd.c (registers_info): Print just the current register's
name.
gdb/testsuite
* gdb.base/pc-fp.exp: Add "info register" tests.

gdb/ChangeLog
gdb/infcmd.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/pc-fp.exp

index 09cb9c2b7ebe91a16e8ee2ba3b9d74e43867a3e5..c7ee48490809e0ae884aa7e72b81270276198ba7 100644 (file)
@@ -1,3 +1,9 @@
+2012-02-15  Tom Tromey  <tromey@redhat.com>
+
+       PR gdb/12659:
+       * infcmd.c (registers_info): Print just the current register's
+       name.
+
 2012-02-15  Tom Tromey  <tromey@redhat.com>
 
        * python/py-symbol.c (sympy_value): Use _().
index e9e3e32afeae133690a82fa384bccdf85f7f65e1..7d929dfa1f334f86bc33c2f4f01b8b421644fff5 100644 (file)
@@ -2170,7 +2170,7 @@ registers_info (char *addr_exp, int fpregs)
                struct value_print_options opts;
                struct value *val = value_of_user_reg (regnum, frame);
 
-               printf_filtered ("%s: ", start);
+               printf_filtered ("%.*s: ", (int) (end - start), start);
                get_formatted_print_options (&opts, 'x');
                val_print_scalar_formatted (check_typedef (value_type (val)),
                                            value_contents_for_printing (val),
index ad9f6783eccd60038feb5f1a76703d41a7d5e9d3..6e6b55d522403ace88c9de6199a523f3d00d42ea 100644 (file)
@@ -1,3 +1,7 @@
+2012-02-15  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.base/pc-fp.exp: Add "info register" tests.
+
 2012-02-15  Tom Tromey  <tromey@redhat.com>
 
        * gdb.base/regs.exp: Remove.
index 9d74eef3b86142db8196a6d379488cab056df5e2..f6500000d51cbb834d4058fd029c6190aa909e79 100644 (file)
@@ -60,11 +60,10 @@ set valueof_fp [get_hexadecimal_valueof "\$fp" "0"]
 gdb_test "display/i \$pc" "1: x/i +\\\$pc( +|\r\n)=> ${valueof_pc}.*"
 gdb_test "display/w \$fp" "2: x/xw +\\\$fp +${valueof_fp}.*"
 
-# FIXME: cagney/2002-09-04: Should also check that ``info registers
-# $pc'' et.al.'' come back with the same value as the above displays
-# and a print --- assuming that is that people agree to such behavour.
-# Need to re-write default_print_registers_info() for it to work (and
-# such a rewrite is on the reggroups branch).
+gdb_test "info register \$pc" "${valueof_pc}.*"
+gdb_test "info register \$fp" "${valueof_fp}.*"
 
-# gdb_test "info registers \$pc" "${valueof_pc}"
-# gdb_test "info registers \$fp" "${valueof_fp}"
+# Regression test for
+# http://sourceware.org/bugzilla/show_bug.cgi?id=12659
+gdb_test "info register pc fp" \
+    "pc: ${valueof_pc}\[\r\n\]+fp: ${valueof_fp}\[\r\n\]+"