From 5401fde353cbd1d5d32a3fcc7721b1a29147b5ba Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Fri, 11 Jul 2014 18:46:33 +0800 Subject: [PATCH] Don't print symbol on address 0x0 We see the following fails on arm-none-eabi target, print (void*)v_signed_char^M $190 = (void *) 0x0 <_ftext>^M (gdb) FAIL: gdb.base/exprs.exp: print (void*)v_signed_char (print (void*)v_signed_char) GDB behaves correctly but the test assumes there is no symbol on address 0x0. This patch is set print symbol off, so that tests below can match the address only. gdb/testsuite: 2014-07-11 Yao Qi * gdb.base/exprs.exp: "set print symbol off". --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/exprs.exp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3ae3754..74f7bce 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-07-11 Yao Qi + + * gdb.base/exprs.exp: "set print symbol off". + 2014-07-11 Pedro Alves * gdb.threads/kill.c: New file. diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index ebce24f..cccc2fd 100644 --- a/gdb/testsuite/gdb.base/exprs.exp +++ b/gdb/testsuite/gdb.base/exprs.exp @@ -200,7 +200,9 @@ test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0- # Test expressions with casts to a pointer. # NB: Some architectures convert a ``NULL'' pointer into # something else. Don't simply test for 0. -# +# Prevent symbol on address 0x0 being printed. +gdb_test_no_output "set print symbol off" + test_expr "set variable v_signed_char = 0" "print (void*)v_signed_char" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_char" test_expr "set variable v_signed_short = 0" "print (void*)v_signed_short" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_short" test_expr "set variable v_signed_int = 0" "print (void*)v_signed_int" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_int" -- 2.7.4