1

My understanding is that in PyEval_FrameEx(), the main loop is on each opcode instruction. Has PyEval_FrameEx the knowledge of being at the end of a Python instruction? Maybe there's an opcode for that?

SebGR
  • 293
  • 2
  • 10

1 Answers1

2

An instruction is identified by one opcode, so there cannot be an opcode to mark the end of instruction. The main loop in PyEval_EvalFrameEx loops over instructions in the frame and executes them one by one, until an error or return is encountered.

If by "Python instruction" you're referring to source constructs such as statements or lines, the closest thing you will find is the line number. See sys.settrace for details.

user4815162342
  • 141,790
  • 18
  • 296
  • 355