From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28802 invoked by alias); 13 Sep 2012 04:17:58 -0000 Received: (qmail 28768 invoked by uid 22791); 13 Sep 2012 04:17:55 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Sep 2012 04:17:42 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8D4HeDQ030595 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Sep 2012 00:17:40 -0400 Received: from host2.jankratochvil.net (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8D4Hasf019409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 13 Sep 2012 00:17:39 -0400 Date: Thu, 13 Sep 2012 04:17:00 -0000 From: Jan Kratochvil To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix disassemble without parameters in tailcall frame Message-ID: <20120913041735.GA1526@host2.jankratochvil.net> References: <20120912153830.GA7317@host2.jankratochvil.net> <5051592F.6030701@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5051592F.6030701@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-09/txt/msg00236.txt.bz2 On Thu, 13 Sep 2012 05:55:27 +0200, Yao Qi wrote: > On 09/12/2012 11:38 PM, Jan Kratochvil wrote: > >+# Test $pc adjustment which is now right after the function end. > >+gdb_test "down" "\r\n#2 .*" > >+gdb_test "disassemble" {Dump of assembler code for function b\(int, double\):.*} > > Do we need to complete the test here to check 'PC doesn't fall in > the range of function b' or ' => is not displayed'? I was thinking about it before. Extended the testcase. Thanks, Jan gdb/ 2012-09-12 Jan Kratochvil Fix disassemble without parameters in tailcall frame. * cli/cli-cmds.c (disassemble_current_function): Use get_frame_address_in_block. gdb/testsuite/ 2012-09-12 Jan Kratochvil Fix disassemble without parameters in tailcall frame. * gdb.arch/amd64-entry-value.exp (down, disassemble): New tests. diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index d3473d5..0bdd373 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1091,7 +1091,7 @@ disassemble_current_function (int flags) frame = get_selected_frame (_("No frame selected.")); gdbarch = get_frame_arch (frame); - pc = get_frame_pc (frame); + pc = get_frame_address_in_block (frame); if (find_pc_partial_function (pc, &name, &low, &high) == 0) error (_("No function contains program counter for selected frame.")); #if defined(TUI) diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.exp b/gdb/testsuite/gdb.arch/amd64-entry-value.exp index dd22d42..455b7a7 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value.exp +++ b/gdb/testsuite/gdb.arch/amd64-entry-value.exp @@ -213,6 +213,25 @@ gdb_test {p $sp0 == $sp} " = true" gdb_test "frame 3" "\r\n#3 .*" gdb_test {p $sp0 + sizeof (void *) == $sp} " = true" +# Test $pc adjustment which is now right after the function end. +# Also verify the current PC indicator "=> " is not displayed anywhere. +gdb_test "down" "\r\n#2 .*" +set test "disassemble" +gdb_test_multiple $test $test { + -re "^$test\r\n" { + exp_continue + } + -re "^Dump of assembler code for function b\\(int, double\\):\r\n" { + exp_continue + } + -re "^ 0x\[^\r\n\]*\r\n" { + exp_continue + } + -re "^End of assembler dump\\.\r\n$gdb_prompt $" { + pass $test + } +} + # Test partial-ambiguous virtual tail call frames chain.