From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29371 invoked by alias); 4 Aug 2011 03:11:05 -0000 Received: (qmail 29208 invoked by uid 22791); 4 Aug 2011 03:11:03 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Aug 2011 03:10:41 +0000 Received: (qmail 6692 invoked from network); 4 Aug 2011 03:10:40 -0000 Received: from unknown (HELO ?192.168.0.101?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Aug 2011 03:10:40 -0000 Message-ID: <4E3A0DAB.603@codesourcery.com> Date: Thu, 04 Aug 2011 03:11:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [patch, testsuite] Set language after reaching to main function Content-Type: multipart/mixed; boundary="------------090702040402060800010705" X-IsSubscribed: yes 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 X-SW-Source: 2011-08/txt/msg00062.txt.bz2 This is a multi-part message in MIME format. --------------090702040402060800010705 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 906 I find some similar failures below when I examine gdb test result, FAIL: gdb.cp/cplusfuncs.exp: set language c++ FAIL: gdb.cp/inherit.exp: set language c++ FAIL: gdb.base/callfuncs.exp: set language c They are all caused by warning emitted by gdb "Warning: the current language does not match this frame.". I examined the frame like this: (gdb) info frame Stack level 0, frame at 0x40017780: pc = 0x40000000 in _reset_ram (reset-ram.S:24); saved pc 0x40000a5c source language asm. Arglist at 0x40017780, args: Locals at 0x40017780, Previous frame's sp is 0x40017780 My gdb is working with bare-mental board, and start up code is written in assembly. That is the reason why gdb emit such warning when we set language while pc is still within assembly code. This patch is to address this problem by moving "set language" after program hits breakpoint on main. OK? -- Yao (齐尧) --------------090702040402060800010705 Content-Type: text/x-patch; name="set_lang_after_main.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="set_lang_after_main.patch" Content-length: 1777 2011-08-04 Yao Qi gdb/testsuite/ * gdb.base/callfuncs.exp: Set language after main. * gdb.cp/cplusfuncs.exp: Likewise. * gdb.cp/inherit.exp: Likewise. diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index 27ebd1e..a12feb8 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -299,10 +299,10 @@ if { $hp_aCC_compiler } { gdb_test_no_output "set overload-resolution 0" } else { - gdb_test_no_output "set language c" if { ![runto_main] } { gdb_suppress_tests; } + gdb_test_no_output "set language c" } get_debug_format diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp index 10e4dac..721a178 100644 --- a/gdb/testsuite/gdb.cp/cplusfuncs.exp +++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp @@ -603,11 +603,11 @@ proc do_tests {} { gdb_reinitialize_dir $srcdir/$subdir gdb_load $binfile - gdb_test_no_output "set language c++" gdb_test_no_output "set width 0" runto_main + gdb_test_no_output "set language c++" probe_demangler test_paddr_overloaded_functions test_paddr_operator_functions diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp index c353394..add7536 100644 --- a/gdb/testsuite/gdb.cp/inherit.exp +++ b/gdb/testsuite/gdb.cp/inherit.exp @@ -728,7 +728,6 @@ proc do_tests { } { gdb_reinitialize_dir $srcdir/$subdir gdb_load $binfile - gdb_test_no_output "set language c++" gdb_test_no_output "set width 0" if { ![runto_main] } then { @@ -736,6 +735,7 @@ proc do_tests { } { return } + gdb_test_no_output "set language c++" test_ptype_si test_ptype_mi test_ptype_vi --------------090702040402060800010705--