Page 1 of 1

Using a Debugger with any text editor (DebugView/++)

Posted: 30 Sep 2021, 10:32
by TheArkive
I do still use a Msgobx now and then for very quick checking of code, but in the long run, to do any meaningful debugging of a complex script, one must use a debugger.

For some reason I didn't feel confident using a debugger for a very long time. It's actually not hard at all, and is well worth the time to setup.

I hope this tutorial will be a help to those who need to go past the Msgbox or the Tooltip for debugging but aren't sure how to do so.

In this tutorial I will show the default settings I use, and explain why.


DebugView++

DebugView


==============================================================================

Use a helper function

==============================================================================

Example

==============================================================================

Editors like VisualStudio Code, AHK Studio, and SciTE for AutoHotkey, catch the OutputputDebug-Output directly within the builtin terminal in a separate panel.

So the Debug-Output will be shown within these text editors. And some other Text Editors / IDE's will support plugins to do the same.

Re: Using a Debugger with any text editor (DebugView)

Posted: 30 Sep 2021, 11:45
by swagfag
debugview is old, debugview++ is new, these screenshots are annoying to open

Re: Using a Debugger with any text editor (DebugView)

Posted: 30 Sep 2021, 11:47
by TheArkive
@swagfag
Ok, sorry, i was trying to contribute, and I didn't see anything like this posted.

I'll look into DebugView++ and update this.

Re: Using a Debugger with any text editor (DebugView)

Posted: 30 Sep 2021, 14:23
by JoeSchmoe
This looks very helpful. Thank you!

Re: Using a Debugger with any text editor (DebugView/++)

Posted: 01 Oct 2021, 06:38
by TheArkive
@JoeSchmoe
No problem :)

@swagfag
Updated to include DebugView++. Any more pointers?

Re: Using a Debugger with any text editor (DebugView/++)

Posted: 01 Oct 2021, 06:44
by swagfag
:thumbup:

Re: Using a Debugger with any text editor (DebugView/++)

Posted: 02 Oct 2021, 01:50
by hoppfrosch
Just one more hint - as you asked for:

Editors like VisualStudio Code catch the OutputputDebug-Output directly within the builtin terminal - no need to have a extra app run, just showing the Debug-Output within the IDE

Re: Using a Debugger with any text editor (DebugView/++)

Posted: 02 Oct 2021, 03:51
by TheArkive
@hoppfrosch
Thanks, I certainly did forget to mention that. OP edited.

Re: Using a Debugger with any text editor (DebugView/++)

Posted: 09 Oct 2021, 20:17
by 20170201225639
Can you outputdebug HTML to vscode's terminal and have it render as HTML?

I want to set it up so each time I enter a function, I do OutputDebug("<div>" A_ThisFunc )

And each time I exit I do OutputDebug(A_ThisFunc "</div>")

And that way I get a hierarchical representation of my callstack using nested html divs! How cool is that?

This is my current setup with debugview++, using indentation to represent the callstack (of my auto exec function). But it'd be nice to represent with html
2021_1009_2115_48 (Forsaken Icefish).png
2021_1009_2115_48 (Forsaken Icefish).png (97.99 KiB) Viewed 4893 times

Re: Using a Debugger with any text editor (DebugView/++)

Posted: 23 Dec 2021, 11:09
by doug9fo
I don't see how to actually use DebugView++ with Notepad++. What is the magic incantation, please?

Re: Using a Debugger with any text editor (DebugView/++)

Posted: 24 Dec 2021, 16:00
by TheArkive
@doug9fo
You don't actually use "DebugView++ with Nodepad++". That statement isn't entirely accurate or complete.

Your script can be edited in Notepad++. And you can design your script to use the DebugOutput command. And then you setup DebugView++ to filter only AHK messages (given the included helper function mentioned in the OP).

If you follow the directions in the OP, you should be able to use Notepad++ to edit your script, and then capture debug output in DebugView++ (with the proper settings/filters set - also described in the OP).