[New-bugs-announce] [issue29367] python-gdb: display wrapper_call()

STINNER Victor report at bugs.python.org
Wed Jan 25 04:29:36 EST 2017

New submission from STINNER Victor:

python-gdb.py handles various Python calls, but not descriptors. Attached patch adds code to display calls to wrapperobject objects.

The patch adds the first "<method-wrapper ...>" line of the traceback:
(gdb) py-bt
Traceback (most recent call first):
  <method-wrapper '__init__' of CodecInfo object at 0x7ffff7e9d7a8>
  File "/home/haypo/prog/python/git_cpython/Lib/encodings/utf_8.py", line 41, in getregentry
  File "/home/haypo/prog/python/git_cpython/Lib/encodings/__init__.py", line 122, in search_function
    entry = getregentry()

I wrote this patch while working on the issue #29358. Object instanciation is full of wrappers. A better debugger helps to me understand my bugs ;-)

Example to get such tracecback:
haypo at selma$ gdb -args ./python -m test -v test_sys
(gdb) b wrapper_call
(gdb) run
(gdb) py-bt
Traceback (most recent call first):
  <method-wrapper '__init__' of _EnumDict object at 0x7ffff023d388>
  File "/home/haypo/prog/python/default/Lib/enum.py", line 66, in __init__
  File "/home/haypo/prog/python/default/Lib/enum.py", line 117, in __prepare__
    enum_dict = _EnumDict()
  <built-in method __build_class__ of module object at remote 0x7ffff7f46c58>
  File "/home/haypo/prog/python/default/Lib/enum.py", line 509, in <module>
    class Enum(metaclass=EnumMeta):
  <built-in method exec of module object at remote 0x7ffff7f46c58>
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed

I guess that the next step is to write a test ;-)

files: gdb_wrapper_call.patch
keywords: patch
messages: 286233
nosy: haypo, inada.naoki
priority: normal
severity: normal
status: open
title: python-gdb: display wrapper_call()
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46411/gdb_wrapper_call.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list