Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-gdb: display wrapper_call() #73553

Closed
vstinner opened this issue Jan 25, 2017 · 9 comments
Closed

python-gdb: display wrapper_call() #73553

vstinner opened this issue Jan 25, 2017 · 9 comments
Labels
3.7 (EOL) end of life type-feature A feature request or enhancement

Comments

@vstinner
Copy link
Member

BPO 29367
Nosy @vstinner, @methane
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • [2.7] bpo-32962: Backport python-gdb.py and test_gdb.py from master (GH-7710) #7726
  • Files
  • gdb_wrapper_call.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-02-01.16:00:50.469>
    created_at = <Date 2017-01-25.09:29:36.407>
    labels = ['type-feature', '3.7']
    title = 'python-gdb: display wrapper_call()'
    updated_at = <Date 2018-06-15.21:59:59.588>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2018-06-15.21:59:59.588>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-02-01.16:00:50.469>
    closer = 'python-dev'
    components = []
    creation = <Date 2017-01-25.09:29:36.407>
    creator = 'vstinner'
    dependencies = []
    files = ['46411']
    hgrepos = []
    issue_num = 29367
    keywords = ['patch']
    message_count = 9.0
    messages = ['286233', '286638', '286640', '286641', '286655', '286665', '286671', '293584', '319680']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'methane', 'python-dev']
    pr_nums = ['552', '7726']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue29367'
    versions = ['Python 3.7']

    @vstinner
    Copy link
    Member Author

    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 bpo-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 ;-)

    @vstinner vstinner added 3.7 (EOL) end of life type-feature A feature request or enhancement labels Jan 25, 2017
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 1, 2017

    New changeset 54fa95b19fae by Victor Stinner in branch 'default':
    python-gdb.py supports method-wrapper
    https://hg.python.org/cpython/rev/54fa95b19fae

    @python-dev python-dev mannequin closed this as completed Feb 1, 2017
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 1, 2017

    New changeset ffd2e5f9256a by Victor Stinner in branch 'default':
    Make test_gdb.test_wrapper_call() make reliable
    https://hg.python.org/cpython/rev/ffd2e5f9256a

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 1, 2017

    New changeset efaf32ac89ec by Victor Stinner in branch 'default':
    Fix test_gdb.test_wrapper_call() on Python 2
    https://hg.python.org/cpython/rev/efaf32ac89ec

    @vstinner
    Copy link
    Member Author

    New changeset d05f7fd by Victor Stinner in branch '3.6':
    [3.6] bpo-30345: Update test_gdb.py and python-gdb.py from master (bpo-1549)
    d05f7fd

    @vstinner
    Copy link
    Member Author

    New changeset e36f94f by Victor Stinner in branch '2.7':
    bpo-32962: Backport python-gdb.py and test_gdb.py from master (GH-7726)
    e36f94f

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 9, 2022

    New changeset 30867b703933d6ba30bc5f609a1a2337925ead33 by Victor Stinner in branch 'master':
    python-gdb.py supports method-wrapper
    30867b7

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 9, 2022

    New changeset 88835e6022a81d8107a296c9f6e5f16c7d39e27a by Victor Stinner in branch 'master':
    Make test_gdb.test_wrapper_call() make reliable
    88835e6

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 9, 2022

    New changeset da331c7d12c4648b9734ebb07e9f722c8478d269 by Victor Stinner in branch 'master':
    Fix test_gdb.test_wrapper_call() on Python 2
    da331c7

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant