From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5938 invoked by alias); 11 Jul 2014 10:53:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5928 invoked by uid 89); 11 Jul 2014 10:53:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Jul 2014 10:53:35 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1X5YSJ-00076L-Fz from Yao_Qi@mentor.com ; Fri, 11 Jul 2014 03:53:31 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 11 Jul 2014 03:53:31 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Fri, 11 Jul 2014 03:53:01 -0700 Message-ID: <53BFC162.8010407@codesourcery.com> Date: Fri, 11 Jul 2014 11:04:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Pedro Alves , Subject: Re: [PATCH][testsuite] Match symbol on address 0x0 References: <1405066663-1395-1-git-send-email-yao@codesourcery.com> <53BFAE35.3040206@redhat.com> In-Reply-To: <53BFAE35.3040206@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00258.txt.bz2 On 07/11/2014 05:28 PM, Pedro Alves wrote: > Indeed that seems like an irrelevant detail for the purpose of > the test. Wouldn't just doing "set print symbol off" work? Oh, it works indeed! How about this? -- Yao (齐尧) 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/gdb.base/exprs.exp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index ebce24f..4647d72 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" -- 1.9.0