From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115620 invoked by alias); 20 Jun 2016 16:11:24 -0000 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 Received: (qmail 113777 invoked by uid 89); 20 Jun 2016 16:11:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,FSL_HELO_HOME,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=H*Ad:U*tom, Block, das X-HELO: gproxy8-pub.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8-pub.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Mon, 20 Jun 2016 16:11:02 +0000 Received: (qmail 24538 invoked by uid 0); 20 Jun 2016 16:11:00 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy8.mail.unifiedlayer.com with SMTP; 20 Jun 2016 16:11:00 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id 94Av1t0062f2jeq014Aybs; Mon, 20 Jun 2016 10:11:00 -0600 X-Authority-Analysis: v=2.1 cv=KpLehwmN c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=PnD2wP_eR3oA:10 a=7XZj0uCbPdcA:10 a=pD_ry4oyNxEA:10 a=zstS-IiYAAAA:8 a=pGLkceISAAAA:8 a=vAjCVHPuAAAA:8 a=90XrTFU3PPuDedHrzfMA:9 a=4G6NA9xxw8l3yy4pmD5M:22 a=6kGIvZw6iX1k4Y-7sg4_:22 a=U9FomqI9nG4SDPFMYEq8:22 Received: from [75.171.172.174] (port=52328 helo=pokyo.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bF1mp-0006Oo-03; Mon, 20 Jun 2016 10:10:55 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA] PR python/18565 - make Frame.function work for inline frames Date: Mon, 20 Jun 2016 16:11:00 -0000 Message-Id: <1466439050-11330-1-git-send-email-tom@tromey.com> X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 75.171.172.174 authed with tom+tromey.com} X-Exim-ID: 1bF1mp-0006Oo-03 X-Source-Sender: (pokyo.Home) [75.171.172.174]:52328 X-Source-Auth: tom+tromey.com X-Email-Count: 0 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-06/txt/msg00332.txt.bz2 PR python/18565 notes that calling frame filters don't work properly for inlined functions. This happens because Frame.function on an inline frame will yield the wrong result. This patch changes this code to use find_frame_funname instead, which handles inline frames properly. Built and regtested on x86-64 Fedora 23. 2016-06-20 Tom Tromey PR python/18565: * python/py-frame.c (frapy_function): Use find_frame_funname. 2016-06-20 Tom Tromey PR python/18565: * gdb.python/py-frame-inline.exp: Add Frame.function test. --- gdb/ChangeLog | 5 +++++ gdb/python/py-frame.c | 6 +++++- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.python/py-frame-inline.exp | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index faa9e9f..8c327c4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-06-20 Tom Tromey + + PR python/18565: + * python/py-frame.c (frapy_function): Use find_frame_funname. + 2016-06-17 Yan-Ting Lin * Makefile.in (ALL_TARGET_OBS): Add nds32-tdep.o. diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index 98a7d7b..6bdac08 100644 --- a/gdb/python/py-frame.c +++ b/gdb/python/py-frame.c @@ -340,9 +340,13 @@ frapy_function (PyObject *self, PyObject *args) TRY { + char *funname; + enum language funlang; + FRAPY_REQUIRE_VALID (self, frame); - sym = find_pc_function (get_frame_address_in_block (frame)); + find_frame_funname (frame, &funname, &funlang, &sym); + xfree (funname); } CATCH (except, RETURN_MASK_ALL) { diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e5f1c54..785b2cb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-20 Tom Tromey + + PR python/18565: + * gdb.python/py-frame-inline.exp: Add Frame.function test. + 2016-06-17 Sanjoy Das * gdb.base/jit-reader.exp: New file. diff --git a/gdb/testsuite/gdb.python/py-frame-inline.exp b/gdb/testsuite/gdb.python/py-frame-inline.exp index 6306c8e..1372ee0 100644 --- a/gdb/testsuite/gdb.python/py-frame-inline.exp +++ b/gdb/testsuite/gdb.python/py-frame-inline.exp @@ -51,3 +51,7 @@ gdb_test_no_output "set backtrace limit 1" gdb_continue_to_breakpoint "Block break here." gdb_test "python print (gdb.newest_frame())" ".*" + +# Regression test to verify that Frame.function works properly for +# inline frames. +gdb_test "python print (gdb.newest_frame().function())" "f" -- 2.5.5