[v2] Callback functions do not display local variables in the debugger. Topic is solved

Report problems with documented functionality
User avatar
thqby
Posts: 420
Joined: 16 Apr 2021, 11:18
Contact:

[v2] Callback functions do not display local variables in the debugger.

16 Sep 2023, 07:31

Code: Select all

(g := Gui()).Add("Button", "xm y+0" " w100" " vBtn2", "Btn 2").OnEvent("Click", BtnClicked)
g.Show()
BtnClicked(btn, *) {
	; Do not display local variables and params in the debugger
	x := btn.Value
	Inner()
	Inner() {
		x := btn.Value
	}
}
https://github.com/AutoHotkey/AutoHotkey/blob/v2.0/source/Debugger.cpp#L2896
Maybe this line should be if (se < mBottom)
lexikos
Posts: 9635
Joined: 30 Sep 2013, 04:07
Contact:

Re: [v2] Callback functions do not display local variables in the debugger.

16 Sep 2023, 19:59

The premise of <= is that there should never be a UDF entry at the bottom of the stack, because there should always be a thread entry. There might not be one when a Fast-mode C callback is called, but that is only in the case of misuse. There probably isn't any benefit in using <= over <, though, so I'll change it.

In this and several related cases, there is no thread entry to indicate that the function is being called by an event. If another function was running, it would look like that other function called this function. That should be fixed (with DEBUGGER_STACK_PUSH/POP), which would also fix the local variables.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 6 guests