huajun07 / codesketcher

Visualise your code in action!
https://main.d1fr5et3wgts3j.amplifyapp.com/
MIT License
0 stars 0 forks source link

Executor misses out some variables #30

Closed limanjun99 closed 1 year ago

limanjun99 commented 1 year ago

Discussed here

In the executor service, we are only getting the local variable values prior to the execution of a line of code. Consider the following code:

def func():
  a = 1
  b = 2

func()

Upon reaching the line b = 2, we can only see that a local variable a is created. However, the very next line jumps to the end of code execution, at which point the local variables a and b are deleted. Hence, we never get to see the value of b at all.

Requires further investigation into how Python's bdb module works in order to resolve.