ahkpp
ahkpp copied to clipboard
After an #include any set breakpoint afterwards in same file never stops
Description
After an #include any set breakpoint afterwards in same file never stops.
Reproduction steps
var1 := 1 ; <-- set breakpoint 1
#include myInclude01.ahk
var2 := 2 ; <-- set breakpoint 2
Expected behavior
Debugging with F9 should stop at "breakpoint 1" and "breakpoint 2".
Failure behavior
Stops at breakpoint 1, but does never stop at breakpoint 2. Seems to be that after an #include any set breakpoint afterwards in same file never stops.
Thanks in advance
Works for me. You are using F9
to initiate debugging and stepping through with F11
?
I was able to reproduce if my file was just the three lines included in the snippet. However, when I added a fourth line MsgBox % var2
the debugger did stop at breakpoint 2 on the third line. Since a breakpoint at the end of a file with an unused assignment (var2
is not used later in the file since it is assigned at the end of the file) isn't a very useful breakpoint, this is low priority. Please inform if you are seeing this issue with slightly more complicated files, or breakpoints after #include
but before the very end of the file.
Yes, I have scripts with many #includes and after that lines of code with definitions for other HotKeys and function methods that I need to debug.
The following seems to be the case a) If #include doesn't define any HotKey --> stops correct at "breakpoint 2"
b) If #include defines any HotKey(s) --> NOT stopping at "breakpoint 2"
Can you provide a short sample script for reproduction purposes @digitalAssetStore?
Hi @digitalAssetStore, since I'm not able to reproduce this issue, I'm going to close it for now. If you can provide a sample script, I'll consider re-opening. Thanks
I've edited my repro setup, I can indeed reproduce this.
; included.ahk
foo() {
MsgBox % "Hello world"
}
x::
MsgBox % "Does it work when included script contains a hotkey?"
; main.ahk
; [Issue #60](https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/issues/60)
var1 := 1 ; <-- set breakpoint 1
#include included.ahk
var2 := 2 ; <-- set breakpoint 2
MsgBox % var2
When debugging main.ahk
, I see the following:
- Debugger stops at breakpoint 1 correctly
- Debugger does not hit breakpoint 2 right away, even expected though it's expected to. Instead, the script keeps running
- When triggering the hotkey (by pressing
x
), the hotkey works as expected - Once the hotkey finishes triggering (by closing the message box), debugger hits breakpoint 2
Honestly, I'm not quite sure what the expected behavior is. @digitalAssetStore , I recommend you try using zero-plusplus.vscode-autohotkey-debug in the meantime.
Apologies for the inconvenience and great delay in thoroughly investigating this issue.