From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18925 invoked by alias); 16 Jun 2011 06:17:33 -0000 Received: (qmail 18917 invoked by uid 22791); 16 Jun 2011 06:17:32 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_BF,T_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, 16 Jun 2011 06:17:18 +0000 Received: (qmail 6154 invoked from network); 15 Jun 2011 14:17:17 -0000 Received: from unknown (HELO ?192.168.0.102?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 15 Jun 2011 14:17:17 -0000 Message-ID: <4DF8BEEF.5010308@codesourcery.com> Date: Thu, 16 Jun 2011 06:17:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [patch] XFAIL gdb.cp/mb-inline.exp conditionaly Content-Type: multipart/mixed; boundary="------------010306050505090109020007" 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-06/txt/msg00227.txt.bz2 This is a multi-part message in MIME format. --------------010306050505090109020007 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 1081 In mb-inline.exp, breakpoint 1.2 is disabled, re-run program, and make sure breakpoint 1.2 is still disabled and program will not hit it. The pre-condition is new inferior created by re-run is loaded at the exactly same address as previous one. However, it is not true on some systems, such as uclinux. On uclinux, new inferior is created on the different address, so status of breakpoint location (enabled or disabled) will not be kept during breakpoint updates. breakpoint 1.2 become enabled, instead of disabled. This will make this FAIL, FAIL: gdb.cp/mb-inline.exp: continue with disabled breakpoint 1.2 This patch is to address this issue. After this patch, in my uclinux port, the test result is like this, # of expected passes 9 # of expected failures 1 but, some times, we can get 10 PASSes, because the new inferior may be created/loaded on the same address as previous one. Note that I also considered to use setup_xfail for uclinux target, but we may get a XPASS, so I didn't write patch in that way. OK for mainline? -- Yao (齐尧) --------------010306050505090109020007 Content-Type: text/x-patch; name="uclinux_mb_inline.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="uclinux_mb_inline.patch" Content-length: 1651 2011-06-15 Yao Qi gdb/testsuite/ * gdb.cp/mb-inline.exp: Set breakpoint on function marker. XFAIL for uclinux. * gdb.cp/mb-inline1.cc (marker): New. diff --git a/gdb/testsuite/gdb.cp/mb-inline.exp b/gdb/testsuite/gdb.cp/mb-inline.exp index 86cb5ba..62708b0 100644 --- a/gdb/testsuite/gdb.cp/mb-inline.exp +++ b/gdb/testsuite/gdb.cp/mb-inline.exp @@ -101,7 +101,24 @@ gdb_expect { } } -gdb_continue_to_end "disabled breakpoint 1.2" + +gdb_test "break marker" \ + "Breakpoint.*at.* file .*, line.*" \ + "set breakpoint on marker" + +gdb_test_multiple "continue" "continue with disabled breakpoint 1.2" { + -re "Breakpoint \[0-9\]+,.*marker.*$gdb_prompt $" { + pass "continue with disabled breakpoint 1.2" + } + -re "Breakpoint \[0-9\]+,.*foo \\(i=1\\).*$gdb_prompt $" { + # When inferior is restarted, breakpoint locations will be updated. + # On uclinux, it is not guaranteed that new inferior is located the + # same address as previous one, so status/state of breakpoint location + # will loose. + setup_xfail "*-*-uclinux*" + fail "continue with disabled breakpoint 1.2" + } +} # Make sure we can set a breakpoint on a source statement that spans # multiple lines. diff --git a/gdb/testsuite/gdb.cp/mb-inline1.cc b/gdb/testsuite/gdb.cp/mb-inline1.cc index 3259002..86dc697 100644 --- a/gdb/testsuite/gdb.cp/mb-inline1.cc +++ b/gdb/testsuite/gdb.cp/mb-inline1.cc @@ -26,10 +26,15 @@ afn () return foo (0) + multi_line_foo (0); } +void +marker () +{} + int main () { int a = afn (); int b = bfn (); + marker (); return a * b; } --------------010306050505090109020007--