AttributeError: 'gdb.Frame' object has no attribute 'function'

Bug #591023 reported by Jean-Paul Calderone
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: gdb

On Lucid, the py-bt gdb macro is broken. To reproduce, run python under gdb and try using it. For example:

exarkun@up:/tmp$ gdb python
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...Reading symbols from /usr/lib/debug/usr/bin/python2.6...done.
done.
(gdb) run
Starting program: /usr/bin/python
[Thread debugging using libthread_db enabled]
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Program received signal SIGINT, Interrupt.
0x0012d422 in __kernel_vsyscall ()
(gdb) py-bt
Traceback (most recent call last):
  File "/usr/lib/debug/usr/bin/python2.6-gdb.py", line 1323, in invoke
    frame = Frame.get_selected_python_frame()
  File "/usr/lib/debug/usr/bin/python2.6-gdb.py", line 1172, in get_selected_python_frame
    if frame.is_evalframeex():
  File "/usr/lib/debug/usr/bin/python2.6-gdb.py", line 1136, in is_evalframeex
    if self._gdbframe.function():
AttributeError: 'gdb.Frame' object has no attribute 'function'
Error occurred in Python command: 'gdb.Frame' object has no attribute 'function'
(gdb) quit

Revision history for this message
Matt Kern (matt-kern-launchpad) wrote :

Dropping a copy of is_evalframeex() from the head of the python trunk into python2.6-gdb.py fixes this issue.

    def is_evalframeex(self):
        '''Is this a PyEval_EvalFrameEx frame?'''
        if self._gdbframe.name() == 'PyEval_EvalFrameEx':
            '''
            I believe we also need to filter on the inline
            struct frame_id.inline_depth, only regarding frames with
            an inline depth of 0 as actually being this function

            So we reject those with type gdb.INLINE_FRAME
            '''
            if self._gdbframe.type() == gdb.NORMAL_FRAME:
                # We have a PyEval_EvalFrameEx frame:
                return True

        return False

See also:
  http://bugs.python.org/issue8279
  http://bugs.python.org/issue8437

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdb (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

apparently fixed in 14.04 LTS

Changed in gdb (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.