GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython (GH-103083)

* The majority of the monitoring code is in instrumentation.c

* The new instrumentation bytecodes are in bytecodes.c

* legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
This commit is contained in:
Mark Shannon 2023-04-12 12:04:55 +01:00 committed by GitHub
parent dce2d38cb0
commit 411b169281
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 6029 additions and 1625 deletions

View file

@ -349,14 +349,14 @@ class CodeTest(unittest.TestCase):
def foo():
pass
# assert that opcode 238 is invalid
self.assertEqual(opname[238], '<238>')
# assert that opcode 229 is invalid
self.assertEqual(opname[229], '<229>')
# change first opcode to 0xee (=238)
# change first opcode to 0xeb (=229)
foo.__code__ = foo.__code__.replace(
co_code=b'\xee' + foo.__code__.co_code[1:])
co_code=b'\xe5' + foo.__code__.co_code[1:])
msg = f"unknown opcode 238"
msg = f"unknown opcode 229"
with self.assertRaisesRegex(SystemError, msg):
foo()