You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cppia debugger reads a function's variables from the wrong frame base #248
With HXCPP_STACK_SCRIPTABLE, the debugger reads a cppia function's this and locals from inStack - stackSize in ScriptCallable::getScriptableVariables, getScriptableValue and setScriptableValue (src/hx/cppia/CppiaFunction.cpp). That isn't where the frame starts: a call sets ctx->frame before this and the arguments are pushed, the function's StackLayout already counts them, and runFunction then allocates the whole layout again before CPPIA_STACK_FRAME pushes the hx::StackFrame. So the frame sits at frame + sizeof(hx::Object *) + argBytes + stackSize, and inStack - stackSize lands on the first argument (or the first local), not on this. The debugger then shows and sets the wrong variables.
libhxcpp still has the three inStack - stackSize reads. Port the upstream fix with a debugger test that reads this, an argument and a local of a cppia function.
Activity