From 421d5d99a304a36cd40126d1e155bb23a8cee02d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 25 Jan 2010 19:31:24 +0000 Subject: [PATCH] gdb 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 | 6 ++++++ gdb/c-valprint.c | 2 +- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/printcmds.exp | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8ab26f61e94..feb59a1b86d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2010-01-25 Tom Tromey + + PR gdb/11049: + * c-valprint.c (c_val_print): Fix test of extract_unsigned_integer + result. + 2010-01-25 Rainer Orth * configure.ac: Only use host_os part when disabling TUI on osf. diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 00c3c9ae1c2..d681a03f96f 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -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; diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c06f0a1a500..61a01f3c2a7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-01-25 Tom Tromey + + PR gdb/11049: + * gdb.base/printcmds.exp (test_print_typedef_arrays): Add test + with "set print null-stop on". + 2010-01-24 Jan Kratochvil * gdb.arch/i386-bp_permanent.exp (Disassemble function '$function'): diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index 74ea6ede309..2f4b0cce0dc 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -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 {} { -- 2.30.2