Still can't access local variables after changing call stack depth
Hi, this is a follow up to this issue. The particular example described in that issue has been fixed, but I'm still experiencing instances of this bug. I was able to reproduce this issue with another example.
To Reproduce
Create a new file named function1.m and paste the following content:
function function1()
a1 = 1;
function2();
end
function function2()
a2 = 2;
disp("hm");
end
- Add a brekpoint on line 8 (the disp statement)
- type
function1in the terminal to execute the program - Click
function1in the call stack, then clickfunction2in the call stack, and then finally clickfunction1in the call stack. Typea1in the terminal - See error
Unrecognized function or variable 'a1'
Expected behavior
a1 should be accessible since we changed the context back to function1, where it was defined.
Useful Information MATLAB Version: 24.2.0.2740171 (R2024b) Update OS Version: Red Hat Enterprise Linux 8.10 VS Code Version: 1.98.2 Extension Version: 1.3.3
Thanks for reporting this issue. This definitely looks like something we would want to resolve. However, so far, I have not able to reproduce the issue. Is this something that is fully reproducible for you every time in a brand new session of vs code with a brand new instance of MATLAB? Or is it something that sporadically happens?
Hi Philip, Yes, I'm able to fully reproduce this 100% every time, with brand new sessions of vs code and MATLAB.
Hi Robert, I have been looking into this again and even when replicating your environment (MATLAB, OS, VS Code, and extension versions) from above to the best of my ability, I have not been able to reproduce it. It shouldn't be platform dependent anyway, but I wanted to make sure.
That makes me think that there must be some slight difference in workflow between us that is having an effect here. Would you be willing to create a screen capture of this issue being reproduced from the start and attach it to this issue?
Hi Philip,
Of course. Please see the screen capture attached: https://github.com/user-attachments/assets/af35c174-2e46-46be-a29a-895ae81ddb00
This also happens when using VS Code connected to a remote using SSH:
MATLAB Version: '24.2.0.2740171 (R2024b) Update 1' VS Code Version: 1.85.2 (system setup) Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681 Date: 2024-01-18T06:40:10.514Z Electron: 25.9.7 ElectronBuildId: 26354273 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045 Extension Version: 1.3.6
Hi,
It looks like the issue only happens when I connect to a remote through SSH.