Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

feat: Add support for Python 3.10 #70

Merged
merged 15 commits into from
Feb 1, 2023

Conversation

mctavish
Copy link
Contributor

This PR adds support for Python 3.10 to the debug agent. A summary of the key changes are:

  • Add handling for new opcodes
  • Add support for PEP-626 - modified API for line numbers:
    • Abstract handling of line numbers so that both old and new APIs can be supported
    • Use co_lines() in Python code for enumerating line numbers in a code object
    • Copy in and use the _PyLineTable functions for handling co_linetable in C++ code
    • Modify InsertAndUpdateLineData to update the code object's linetable data using the 3.10 format. Note that this will need to be modified again for Python 3.11 which uses a condensed version of the linetable.
    • Update tests to handle the linetable changes
  • Update tests to handle modified JUMP offsets
  • Update tests to handle modified error messages

@mctavish mctavish marked this pull request as ready for review January 31, 2023 15:20
Copy link
Contributor

@jasonborg jasonborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Glad to see this was able to get done, congrats.

src/googleclouddebugger/bytecode_manipulator.cc Outdated Show resolved Hide resolved
src/googleclouddebugger/module_explorer.py Outdated Show resolved Hide resolved
src/googleclouddebugger/immutability_tracer.cc Outdated Show resolved Hide resolved
@mctavish mctavish merged commit 5148366 into GoogleCloudPlatform:main Feb 1, 2023
@mctavish mctavish deleted the python3.10 branch February 1, 2023 15:32
@mctavish mctavish linked an issue Feb 1, 2023 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support python 3.10
2 participants