Message286233
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
streamwriter=StreamWriter,
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@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__
super().__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 ;-) |
|
Date |
User |
Action |
Args |
2017-01-25 09:29:36 | vstinner | set | recipients:
+ vstinner, methane |
2017-01-25 09:29:36 | vstinner | set | messageid: <1485336576.45.0.391174330106.issue29367@psf.upfronthosting.co.za> |
2017-01-25 09:29:36 | vstinner | link | issue29367 messages |
2017-01-25 09:29:35 | vstinner | create | |
|