Breakpoints do not capture upvalues

If a breakpoint is placed within a nested scope (where the scope itself has not captured an upvalue) and the breakpoint attempts to access said upvalue, it will retrieve nil.

For example, in this code, if a logpoint is placed on line 4 within foo and attempts to access myUpvalue, it will log nil:

local myUpvalue = 10

local function foo()
	print("foo happened")
end

foo()


Output:
image
However, if foo captures myUpvalue by giving it to print, then the logpoint works as expected:

local myUpvalue = 10

local function foo()
	print("foo happened", myUpvalue)
end

foo()

Output:
image

This behavior makes debugging with breakpoints annoying, as I need to manually edit code to capture upvalues if I want to observe them for conditional or logging purposes.

Expected behavior

I expect breakpoints to capture and read upvalues.

Thanks for letting us know about this. An issue has been filed and the relevant team will be notified.

Thank you for the report!

Unfortunately, if the values are not captured by the function, they do not exist from the perspective of the function and cannot be evaluated by the breakpoint.

Are there any plans to let breakpoints capture upvalues if the function does not?

No, we do not have plans to add support for that.