SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

The popular SciTE-based AutoHotkey Script Editor
User avatar
evilC
Posts: 4341
Joined: 27 Feb 2014, 12:30

SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

12 Jul 2017, 16:37

This is not my work. I am merely packaging the work of Fincs and Lexikos for easy consumption by the community.

The main Scite4AutoHotkey thread is here


What does it do?
It brings enhanced functionality to SciTE4AutoHotkey, including:
DebugVars
Image
A really nice little variable browser that allows you to explore variables and objects, and stays expanded as you step through code.
To open it, once debugging, click the icon under the mouse cursor in the screenshot above
AHK_H and AHK_L compatible.

Breakpoints in included files
If you place a breakpoint in an included file, then start debugging the main script, the breakpoint will now be hit.

Installing
  1. Install regular S4AHK from here
  2. Run S4AHK and let it update, then close it
  3. Download the zip attached to this post, and extract it's contents into your Scite folder, overwriting.
Build Notes
I found it less than trivial to build this thing, so for others wishing to build it (And to jog my memory in future), here is how it is done:

Base instructions that I drew this from are here and here.

Pertinent posts in the main thread (Mainly to stop me having to dig around if I need to refer to them again)

You will need the following applications to build:
  • CygWin
    When installing CygWin, at the stage when it pops up the packages, you need to add the "patch" package (Select "Full" from the dropdown and search for "patch"). If you miss it, just re-run the installer
  • Visual Studio 2015 or greater (Community edition is free, works fine)
Build process:
  1. Clone S4AHK repo from https://github.com/Lexikos/SciTE4AutoHotkey
    The folder you clone to will be referred to as <GithubFolder>
  2. Extract the contents of scite360.tgz to <GithubFolder>
    You may need to extract twice - the first time should yield scite360.tar, then extract again
    <GithubFolder> should now contain the following folders:
    installer
    scintilla
    scipatches
    scite
    source
  3. Open a Cygwin prompt to <GithubFolder>\source
  4. Execute patch -p1 < scipatches/S4AHK.patch
  5. Double-click <GithubFolder>\SciTE4AutoHotkey.sln to open the project in Visual Studio
  6. At the top of the screen, make sure the two dropdowns are set to Release and Win32
    Image
  7. Select Build -> Build Solution
  8. Copy SciTE.exe and SciLexer.dll from <GithubFolder>\bin\debug\x86 to <GithubFolder>\source
  9. Take a copy of the latest 32-bit Unicode AutoHotkey.exe, rename it InternalAHK.exe and place it in <GithubFolder>\source
The contents of <GithubFolder>\source is now a patch, you can copy the contents of this folder over an existing Scite4Autohotkey install to update it.
Attachments
SciTE4AHK.zip
(1.72 MiB) Downloaded 494 times
Last edited by evilC on 09 Aug 2017, 15:02, edited 1 time in total.
User avatar
gregster
Posts: 1394
Joined: 30 Sep 2013, 06:48

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

12 Jul 2017, 18:21

Thank you, EvilC - and of course Fincs and Lexikos - for putting this together. Seems to work fine and will surely be useful for debugging! I always wanted to look into the abilities of the DebugVars script... and Scite4AHK I already use. So, that's perfect!
User avatar
Taurus
Posts: 49
Joined: 20 Jan 2015, 10:31

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

14 Aug 2017, 08:19

Perfect! Thank you, EvilC and all the others.

I created a small improvement for working with F12, maybe you are interested in modifying this file:

Code: Select all

; Needs Admin-Rights for modifications
full_command_line := DllCall("GetCommandLine", "str")

if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
    try
    {
        if A_IsCompiled
            Run *RunAs "%A_ScriptFullPath%" /restart
        else
            Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
    }
    ExitApp
}

Improve_IDE:
SetWorkingDir, % "C:\Program Files\AutoHotkey\SciTE"

; Better Function/Label List (F12)
FileRead, tmp, tillagoto.properties

tmp := StrReplace(tmp, "tillagoto.gui.width=230", "tillagoto.gui.width=400")
tmp := StrReplace(tmp, "tillagoto.gui.height=12", "tillagoto.gui.height=50")
tmp := StrReplace(tmp, "tillagoto.gui.font.size=8", "tillagoto.gui.font.size=12")
tmp := StrReplace(tmp, "tillagoto.gui.sort.entries=1", "tillagoto.gui.sort.entries=0") ; no sort is better for overview, if you name one task after another with Labels

FileDelete, tillagoto.properties
FileAppend, % tmp, tillagoto.properties
Dev for a better world :) > PHP for Web > AHK H for Local > with KISS (Keep it Short and Simple) on Win 10 Pro (Version 1709) x64
MPD
Posts: 2
Joined: 03 Nov 2017, 13:06

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

05 Nov 2017, 08:31

This is great set of added functionality as I'm keep all my classes in one ugly file at the moment, just because of the breakpoint issue this addresses. However, I've seen an odd issue where the performance when you're debugging grinds to a halt using this version of the code.

Stepping through code on the standard 3.0.06.01 build in real-time, after this mod, often takes several seconds per F10/F11 step. Using ANSI as a platform if that matters. Happy to help provide further diagnostics if you let me know what you need
lexikos
Posts: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

30 Nov 2017, 16:34

The DebugVars window tends to display a lot more information than the original variable list, and requires a proportionate number of DBGp requests. If it slows down, try minimising some object nodes. (I've not seen it quite as slow as MPD described, but it may depend on the system and the amount of information displayed.)
MPD
Posts: 2
Joined: 03 Nov 2017, 13:06

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

04 Dec 2017, 08:55

confirmed - when I'm seeing the issue there are no nodes open, but quite a complex object hierarchy
User avatar
slappycat2
Posts: 5
Joined: 15 May 2015, 05:54
GitHub: slappycat2

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

09 Apr 2018, 12:30

Good stuff, Lexicos and evilC!
I really like this, but I'm worried about deviating from the standard code line. Is this change going to be "built-in" in the near future?

Thanks in advance!
As the Zen Master said to the Hot Dog Vendor: Make me one with everything! :yawn:
lexikos
Posts: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

10 Apr 2018, 16:39

I don't think you have anything to worry about. SciTE4AutoHotkey hasn't been updated in 3.5 years.
User avatar
slappycat2
Posts: 5
Joined: 15 May 2015, 05:54
GitHub: slappycat2

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

10 Apr 2018, 18:38

Thanks, Lexicos! Keep up the awesome work!
As the Zen Master said to the Hot Dog Vendor: Make me one with everything! :yawn:
SAbboushi
Posts: 130
Joined: 08 Dec 2014, 22:13

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

03 Jul 2018, 12:19

Great stuff - thanks folks.

I found value in Lexicos' readme.md for DebugVars.ahk

Being able to run DebugVars.ahk using DebugVarsGui to display a separate window with a node for each running script with real-time access to view/modify AHK v1 and AHK V2 running scripts' variables (some running elevated), while debugging an AHK V2 script using SciTE4AutoHotkey with EvilC's S4AHK patch...

PRICELESS!!!!
SAbboushi
Posts: 130
Joined: 08 Dec 2014, 22:13

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

08 Aug 2018, 10:56

2 annoyances: one I've found how to resolve
  • each time I start a new debug session on my script, my debug Variables window opens up several pixels wider than it was last time. I suspect it has to do with AHK V1 WinGetPos gets the full window dimensions, while the Gui Show, w%Width%... command ignores window caption and some other extra pixels.
    I use multiple monitors and Variables window is maximized on one of my monitors. Each time Variables window opens, it extends to (and covers a growing part of) another monitor which is annoying. I have to keep resizing Variables window. Anyone know of a way to fix this/automated workaround?
  • Every couple of weeks or so, my debug Variables window disappears and I can't get it back. I've tracked the problem to the "SciTE\user\SciTEDebug.ini" file. It has a section with bogus x & y params:

    Code: Select all

    [Windows]
    1=x-32000 y-32000 w382 h264, variables
    Since that's the only entry in the file, I just delete the file and my debug Variables window now comes back.
User avatar
evilC
Posts: 4341
Joined: 27 Feb 2014, 12:30

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

08 Aug 2018, 13:13

Do you have multiple monitors? I have seen issues before with any script that records window location between runs.
Sometimes it just seems to glitch out - it could be due to how the address space maps out, something as subtle as switching your monitors around or which port they are plugged into might affect it
Granted though, it's not that hard to write code to detect if that value is not visible, and move it on-screen.
I didn't write any of the code though, I just packaged it.
lexikos
Posts: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

08 Aug 2018, 17:19

A value of -32000 usually means the window is minimized. Do you have a hotkey that minimizes windows? I do not think there is any other way to minimize this window.

Maximized, or just sized to fill the screen? The window has no maximize button. Maximized windows are sized larger than the screen. If you maximize the window with WinMaximize, the saved size will be inappropriate for the normal non-maximized state. The script does not restore the maximized state, because you aren't supposed to be able to maximize the window.
I suspect it has to do with AHK V1 WinGetPos gets the full window dimensions, while the Gui Show, w%Width%... command ignores window caption and some other extra pixels.
If that were the case, it would happen for everyone. It works correctly for me. WinGetPos is used only to retrieve the position of the window, not the size.
SAbboushi
Posts: 130
Joined: 08 Dec 2014, 22:13

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

08 Aug 2018, 18:44

Thanks for the replies--
evilC wrote:I didn't write any of the code though, I just packaged it.
I know - your post makes that quite clear! I was just posting about the disappearing window in case it was helpful to someone else.
lexikos wrote:Do you have a hotkey that minimizes windows? I do not think there is any other way to minimize this window.
No.
lexikos wrote:Maximized, or just sized to fill the screen? The window has no maximize button.

I believe Maximixed (yes, it has no maximize button, but double-clicking on window header maximizes the window as far as I can tell).

lexikos wrote:If that were the case, it would happen for everyone. It works correctly for me. WinGetPos is used only to retrieve the position of the window, not the size.
I'm quoting from someone else's post which seemed to accurately describe the problem I'm experiencing with the debug Variables window.
lexikos
Posts: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

09 Aug 2018, 02:42

OK, apparently making the window resizable allows it to be maximized by double-clicking the titlebar even though there is no maximize button. The potential workarounds and fixes are:
  • Just don't maximize the window.
  • Change SaveDvWindows() to include the word Maximize in the IniWrite value if the window is maximized.
  • Disable or remove the Maximize option in each window's system menu to prevent maximizing.
  • Block the WM_SYSCOMMAND,SCMAXIMIZE message to prevent maximizing.
  • Put the correct parameters into the ini file and set it to read-only to prevent the script from changing them.
lexikos
Posts: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: SciTE4AutoHotkey v3.0.06.01 Lexikos' DebugVars build [Updated 12th July 2017]

22 Aug 2018, 04:19

I have updated Lexikos/SciTE4AutoHotkey to fix a few issues and add support for selecting stack depth. Double-clicking a stack entry will now set the 'depth' used when querying local variables, allowing the debugger to see local variables of running functions other than the current one. This requires v1.1.30+ or v2.0-a099+; earlier versions will simply return no variables if depth is non-zero. Depth reverts to zero when execution resumes.

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 5 guests