From 282a0691a725d1f6653840728449adb297c8c856 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 12 Jun 2016 20:45:29 -0600 Subject: PR python/18565 - make Frame.function work for inline frames 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 24. 2016-08-03 Tom Tromey PR python/18565: * python/py-frame.c (frapy_function): Use find_frame_funname. 2016-08-03 Tom Tromey PR python/18565: * gdb.python/py-frame-inline.exp: Add Frame.function test. --- gdb/python/py-frame.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/python') 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) { -- cgit v1.1