gdb
authorTom Tromey <tromey@redhat.com>
Mon, 25 Jan 2010 19:31:24 +0000 (19:31 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 25 Jan 2010 19:31:24 +0000 (19:31 +0000)
PR gdb/11049:
* c-valprint.c (c_val_print): Fix test of extract_unsigned_integer
result.
gdb/testsuite
PR gdb/11049:
* gdb.base/printcmds.exp (test_print_typedef_arrays): Add test
with "set print null-stop on".

gdb/ChangeLog
gdb/c-valprint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/printcmds.exp

index 8ab26f6..feb59a1 100644 (file)
@@ -1,3 +1,9 @@
+2010-01-25  Tom Tromey  <tromey@redhat.com>
+
+       PR gdb/11049:
+       * c-valprint.c (c_val_print): Fix test of extract_unsigned_integer
+       result.
+
 2010-01-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * configure.ac: Only use host_os part when disabling TUI on osf.
index 00c3c9a..d681a03 100644 (file)
@@ -191,7 +191,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
                        && temp_len < options->print_max
                        && extract_unsigned_integer (valaddr + embedded_offset
                                                     + temp_len * eltlen,
-                                                    eltlen, byte_order) == 0);
+                                                    eltlen, byte_order) != 0);
                       ++temp_len)
                    ;
                  len = temp_len;
index c06f0a1..61a01f3 100644 (file)
@@ -1,3 +1,9 @@
+2010-01-25  Tom Tromey  <tromey@redhat.com>
+
+       PR gdb/11049:
+       * gdb.base/printcmds.exp (test_print_typedef_arrays): Add test
+       with "set print null-stop on".
+
 2010-01-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.arch/i386-bp_permanent.exp (Disassemble function '$function'):
index 74ea6ed..2f4b0cc 100644 (file)
@@ -582,6 +582,11 @@ proc test_print_typedef_arrays {} {
        " = \"abcd\""
     gdb_test "p a2\[0\]" " = 97 'a'"
     gdb_test "p a2\[3\]" " = 100 'd'"
+
+    # Regression test of null-stop; PR 11049.
+    gdb_test "set print null-stop on" ""
+    gdb_test "p a2" " = \"abcd\"" "print a2 with null-stop on"
+    gdb_test "set print null-stop off" ""
 }
 
 proc test_artificial_arrays {} {