mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
python-gdb.py supports method-wrapper
Issue #29367: python-gdb.py now supports also method-wrapper (wrapperobject) objects.
This commit is contained in:
parent
c9473b838a
commit
611083331d
3 changed files with 71 additions and 6 deletions
|
|
@ -3,13 +3,14 @@
|
|||
# The code for testing gdb was adapted from similar work in Unladen Swallow's
|
||||
# Lib/test/test_jit_gdb.py
|
||||
|
||||
import locale
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import sysconfig
|
||||
import textwrap
|
||||
import unittest
|
||||
import locale
|
||||
|
||||
# Is this Python configured to support threads?
|
||||
try:
|
||||
|
|
@ -847,6 +848,24 @@ id(42)
|
|||
)
|
||||
self.assertIn('#1 <built-in method gmtime', gdb_output)
|
||||
|
||||
@unittest.skipIf(python_is_optimized(),
|
||||
"Python was compiled with optimizations")
|
||||
def test_wrapper_call(self):
|
||||
cmd = textwrap.dedent('''
|
||||
class MyList(list):
|
||||
def __init__(self):
|
||||
super().__init__() # wrapper_call()
|
||||
|
||||
l = MyList()
|
||||
''')
|
||||
# Verify with "py-bt":
|
||||
gdb_output = self.get_stack_trace(cmd,
|
||||
breakpoint='wrapper_call',
|
||||
cmds_after_breakpoint=['py-bt'],
|
||||
)
|
||||
self.assertIn("<method-wrapper '__init__' of MyList object at ",
|
||||
gdb_output)
|
||||
|
||||
|
||||
class PyPrintTests(DebuggerTests):
|
||||
@unittest.skipIf(python_is_optimized(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue