From patchwork Thu Aug 14 03:59:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 2393 Received: (qmail 12825 invoked by alias); 14 Aug 2014 04:04:09 -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 12804 invoked by uid 89); 14 Aug 2014 04:04:03 -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; Thu, 14 Aug 2014 04:03:58 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1XHmGY-0007cd-NG from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 13 Aug 2014 21:03:54 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 13 Aug 2014 21:03:54 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Wed, 13 Aug 2014 21:03:53 -0700 From: Yao Qi To: Subject: [PATCH] Set print symbol off in some tests Date: Thu, 14 Aug 2014 11:59:51 +0800 Message-ID: <1407988791-14057-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes GDB in default prints the symbol associated on an address, and tests assume that there is no symbol on address zero. However, on bare metal target, address may be mapped to zero and there may be a symbol. Then, some tests fails as below: print const_cast (0)^M $8 = (void *) 0x0 <_ftext>^M (gdb) FAIL: gdb.cp/casts.exp: const_cast of 0 p acp->c1^M $9 = (A *) 0x0 <_ftext>^M (gdb) FAIL: gdb.cp/class2.exp: p acp->c1 This patch is to set print symbol off in these tests, like what I did previously https://sourceware.org/ml/gdb-patches/2014-07/msg00257.html gdb/testsuite: 2014-08-14 Yao Qi * gdb.cp/casts.exp: Set print symbol off. * gdb.cp/class2.exp: Likewise. * gdb.cp/overload.exp: Likewise. * gdb.cp/templates.exp: Likewise. --- gdb/testsuite/gdb.cp/casts.exp | 3 +++ gdb/testsuite/gdb.cp/class2.exp | 3 ++- gdb/testsuite/gdb.cp/overload.exp | 3 +++ gdb/testsuite/gdb.cp/templates.exp | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp index 9122450..e28f311 100644 --- a/gdb/testsuite/gdb.cp/casts.exp +++ b/gdb/testsuite/gdb.cp/casts.exp @@ -42,6 +42,9 @@ if ![runto_main] then { continue } +# Prevent symbol on address 0x0 being printed. +gdb_test_no_output "set print symbol off" + gdb_test "break [gdb_get_line_number "casts.exp: 1"]" \ "Breakpoint.*at.* file .*" \ "" diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp index 82faac5..eae5922 100644 --- a/gdb/testsuite/gdb.cp/class2.exp +++ b/gdb/testsuite/gdb.cp/class2.exp @@ -28,9 +28,10 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { return -1 } -# Start with "set print object off". +# Start with "set print object off" and "set print symbol off". gdb_test_no_output "set print object off" +gdb_test_no_output "set print symbol off" if ![runto_main] then { perror "couldn't run to main" diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp index 73232f7..aea2efc 100644 --- a/gdb/testsuite/gdb.cp/overload.exp +++ b/gdb/testsuite/gdb.cp/overload.exp @@ -39,6 +39,9 @@ if ![runto 'marker1'] then { continue } +# Prevent symbol on address 0x0 being printed. +gdb_test_no_output "set print symbol off" + gdb_test "up" ".*main.*" "up from marker1" # Print the monster class type. diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 0cc0e84..42dc1df 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -293,6 +293,8 @@ gdb_test "c" \ gdb_test "print fint" \ "\\$\[0-9\]* = \\{x = 0, t = 0\\}" +# Prevent symbol on address 0x0 being printed. +gdb_test_no_output "set print symbol off" gdb_test "print fvpchar" \ "\\$\[0-9\]* = \\{x = 0, t = 0x0\\}"