6 ms·
The Python Cloud Debugger works with the standard (unmodified) CPython 2.7.x. Breakpoints are implemented by rewriting Python bytecode at runtime. The debugger
by vlflnd 11y ago
The Python Cloud Debugger works with the standard (unmodified) CPython 2.7.x. Breakpoints are implemented by rewriting Python bytecode at runtime. The debugger inserts a method call at the breakpoint location in a code object. This method tells the debugger that the code reached a particular point. Generator functions are particularly tricky because they need to maintain correct offsets at "yield" points.
This source file implements all of it:
https://github.com/GoogleCloudPlatform/cloud-debug-python/blob/master/src/googleclouddebugger/bytecode_manipulator.cc https://github.com/GoogleCloudPlatform/cloud-debug-python/bl...