From patchwork Fri Jul 11 10:50:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 2033 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-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@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 18:50:10 +0800 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> X-IsSubscribed: yes 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? 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"