This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: fix PR 11049
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 25 Jan 2010 12:31:05 -0700
- Subject: FYI: fix PR 11049
- Reply-to: tromey at redhat dot com
I'm checking this.
This fixes PR 11049, a regression in "set print null-stop on".
I think I introduced this during my charset rewrite; it turns out that
there are no tests in the test suite for this functionality.
The fix is trivial, as the bug was an inverted test.
I added a regression test for this case, as well.
Built and regtested on x86-64 (compile farm).
Tom
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 Tom Tromey <tromey@redhat.com>
PR gdb/11049:
* gdb.base/printcmds.exp (test_print_typedef_arrays): Add test
with "set print null-stop on".
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.65
diff -u -r1.65 c-valprint.c
--- c-valprint.c 14 Jan 2010 08:03:35 -0000 1.65
+++ c-valprint.c 25 Jan 2010 19:29:22 -0000
@@ -191,7 +191,7 @@
&& 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: testsuite/gdb.base/printcmds.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/printcmds.exp,v
retrieving revision 1.27
diff -u -r1.27 printcmds.exp
--- testsuite/gdb.base/printcmds.exp 11 Jan 2010 17:58:16 -0000 1.27
+++ testsuite/gdb.base/printcmds.exp 25 Jan 2010 19:29:24 -0000
@@ -582,6 +582,11 @@
" = \"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 {} {