From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4262 invoked by alias); 27 Apr 2011 06:43:43 -0000 Received: (qmail 4253 invoked by uid 22791); 27 Apr 2011 06:43:41 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp01.br.ibm.com (HELO e24smtp01.br.ibm.com) (32.104.18.85) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Apr 2011 06:43:11 +0000 Received: from mailhub1.br.ibm.com (mailhub1.br.ibm.com [9.18.232.109]) by e24smtp01.br.ibm.com (8.14.4/8.13.1) with ESMTP id p3R7ffOO025004 for ; Wed, 27 Apr 2011 03:41:41 -0400 Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3R6iBVn1704278 for ; Wed, 27 Apr 2011 03:44:11 -0300 Received: from d24av04.br.ibm.com (loopback [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3R6gobt019051 for ; Wed, 27 Apr 2011 03:42:50 -0300 Received: from [9.12.225.250] ([9.12.225.250]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p3R6glLf019043 for ; Wed, 27 Apr 2011 03:42:49 -0300 Message-ID: <4DB7BAEF.3070303@linux.vnet.ibm.com> Date: Wed, 27 Apr 2011 06:43:00 -0000 From: Edjunior Barbosa Machado User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110402 Lightning/1.0b2 Icedove/3.1.9 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [PATCH] testsuite: inline-cmds.exp: adjust checks with 'finish' command Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-04/txt/msg00497.txt.bz2 Hi, as previously discussed in the mailing list (http://sourceware.org/ml/gdb/2010-11/msg00032.html), the behavior of 'finish' command may be slightly different on some architectures (as ppc64, for instance) where there will be one or more instructions after a call instruction that are still part of the subroutine call block. In these cases, after issue 'finish' gdb will show the caller line again instead of the next line. Please consider the following fix for checks with 'finish' in gdb.opt/inline-cmds.exp. Tested on x86, ppc32 and ppc64. Ok to apply? Thanks, -- Edjunior diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 0485d21..c576005 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-27 Edjunior Machado + + * gdb.opt/inline-cmds.exp: Adjust checks with "finish" command to + accept to show the caller line again as well as the line after. + 2011-04-25 Jan Kratochvil * gdb.base/gdbindex-stabs-dwarf.c: New file. diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp index cde86f5..cbf3160 100644 --- a/gdb/testsuite/gdb.opt/inline-cmds.exp +++ b/gdb/testsuite/gdb.opt/inline-cmds.exp @@ -263,7 +263,20 @@ gdb_continue_to_breakpoint "finish into func1" gdb_test "next" ".*marker \\\(\\\);" "next to finish marker" gdb_test "step" ".*set breakpoint 2 here.*" "step into finish marker" -gdb_test "finish" "func1 \\\(\\\);" "finish from marker to func1" + +# Some architectures will have one or more instructions after +# the call instruction which still are part of the call sequence, +# so it should be expected to return to the caller line after issue +# a 'finish' command. +gdb_test_multiple "finish" "finish from marker" { + -re "func1 \\\(\\\);.*" { + pass "finish from marker to func1" + } + -re "marker \\\(\\\);.*" { + pass "finish from marker" + gdb_test "step" "func1 \\\(\\\);.*" "step after marker to reach func1" + } +} gdb_test "step" "bar \\\(\\\);" "step into func1 for finish" gdb_test "finish" "func3 \\\(\\\);" "finish from func1 to func3" @@ -273,7 +286,15 @@ set line6 [gdb_get_line_number "set breakpoint 6 here"] gdb_breakpoint $line6 gdb_continue_to_breakpoint "before the outer_inline call" gdb_test "step" "marker \\\(\\\) at .*" "reach 1 the outer_inline call" -gdb_test "finish" "main \\\(\\\) at .*outer_inline2 \\\(\\\);" "reach outer_inline2" +gdb_test_multiple "finish" "finish from marker" { + -re "main \\\(\\\) at .*outer_inline2 \\\(\\\);.*" { + pass "reach outer_inline2" + } + -re "main \\\(\\\) at .*marker \\\(\\\);.*" { + pass "finish from marker" + gdb_test "step" "outer_inline2 \\\(\\\);.*" "step after marker to reach outer_inline2" + } +} gdb_test "bt" "#0 main.*" "backtrace at main of outer_inline" gdb_test "step" "outer_inline2 \\\(\\\) at .*" "enter outer_inline2" gdb_test "bt" "#0 outer_inline2.*#1 main.*" "backtrace at outer_inline2"