zero-plusplus / vscode-autohotkey-debug

https://marketplace.visualstudio.com/items?itemName=zero-plusplus.vscode-autohotkey-debug
MIT License
50 stars 4 forks source link

Ideas on pseudo step-back #318

Open zero-plusplus opened 6 months ago

zero-plusplus commented 6 months ago

What is this?

When debugging, do you ever pass by when stepping to the desired line?

I often have that experience.

In such cases, step-back execution allows you to go back to the target line.

But it would be difficult for the AutoHotkey debugger to support this.

So I have thought of a way to implement a pseudo step-back and will leave a note on that.

Implementation

How to implement. The answer is to re-run the script and use conditional breakpoint.

I focused on the advantage of using step-back execution is that the data can be checked in the same context.

Then it occurred to me that if it can be verified that it has the same call stack and the same arguments, then it can check the data in the same context.

In other words, you can pseudo benefit from step-back execution by giving it the ability to place a breakpoint with a condition attached to it in that way.

In practical scripts, it is not always possible to break in the same context, but I think it has a certain effect during testing.

It may not work as well as expected due to the many limitations, but I think it's an interesting experiment and I'll leave it here.

If there is demand and if I can afford it, I would like to implement it as an experimental feature.