Page 1 of 1

Notepad++ Debugger

Posted: 26 Dec 2019, 16:05
by TheDewd
I'm trying to setup a debugger for Notepad++/AutoHotkey on my work computer.

I use AutoHotkey at work, however I am not permitted to run any commands that require administrator privileges. I use a lot of portable apps to bypass this restriction.

I have AutoHotkey and Notepad++ both extracted to separate folders, and I'm trying to use the DBGp plugin for Notepad++ but I don't know what I'm doing.

Can someone please help me get a debugger working in Notepad++? Thanks!

I have chosen the AutoHotkey.exe file as the default "Open With..." application to run ".ahk" script files with executed.

I've also installed the DBGp plugin for Notepad++.

I don't know what I'm supposed to do to enable the debugging. I use the "RunMe" plugin usually to run the script from Notepad++ with the default application with a click of a button.

Until now, I always use MsgBox, ToolTip, etc for my debugging purposes, but would like to finally start using a debugger tool.

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 16:36
by toralf
I just posted a few days ago my AHK Project Manager in the script section of this Forum. It makes use of the debug plugin of npp.
You may try it.
Besides that you could also just run AHK with the /debug option. Then it should automatically connect with the DBGp within NPP.

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 16:40
by TheDewd
When I try to launch AutoHotkey.exe /Debug the AutoHotkey.chm file is launched and the debugger is still not connecting.

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 16:46
by toralf
You need to add your script as well

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 16:55
by TheDewd
That shows the AutoHotkey icon in the tray/notification area. It refuses to show a menu on right-click.

Reloading the script with #SingleInstance, Force results in error Could not close the previous instance of this script. Keep waiting?

I have to close the process from the task manager.

No luck. :( Not detecting the debugger in Notepad++.

Also, every time I run the plugin I get this message:

Code: Select all

---------------------------
PluginsManager::runPluginCommand Exception
---------------------------
Unlisted exception
---------------------------
OK   
---------------------------

It does not work.

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:06
by toralf
What npp and dbgp versions do you use?

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:08
by toralf
Please try a very simple script that will run for sure, e.g. only 3 lines with message boxes and a few variables

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:09
by toralf
Npp has to be 32 bit I believe for some plugins to work. IIRC DBGp is one of them.

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:10
by TheDewd
AutoHotkey 1.1.32.00 (32-bit)
DBGp 0.0.13.27
Notepad++ 7.7.1 (32-bit)

Code: Select all

#SingleInstance, Force
#Persistent

OutputDebug, Testing...

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:13
by toralf
Do not use ouputdebug.
Just msg box
And what are your settings for DBGp?

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:17
by toralf
I have npp 7.8.2 but I have been using older versions as well with dbgp.
How did you install dbgp?
Maybe start installation of npp and dbgp from scratch again.

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:18
by TheDewd
CommandLine Example: "C:\Users\Username\...\AutoHotkey\AutoHotkey.exe" /Debug "C:\Users\Username\Downloads\New AutoHotkey Script.ahk"

Code: Select all

#SingleInstance, Force
#Persistent

MsgBox, Testing...
I downloaded the latest version of N++ portable and installed the plugin again using the built-in plugin manager and same issue...

DBGp settings attached.
Untitled.png
DBGp Settings Window
(7.99 KiB) Downloaded 176 times

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:21
by toralf
You either have to set a break point in the script or check break on first line

Re: Notepad++ Debugger

Posted: 26 Dec 2019, 17:31
by toralf
I”m off now, good luck .
I”LL check back tomorrow

Re: Notepad++ Debugger

Posted: 27 Dec 2019, 12:19
by TheDewd
The problem seems to be the AutoHotkey executable.

Whenever I attempt to launch the script AutoHotkey.exe /Debug YourScript.ahk, the icon appears in the notification/tray area and it's not possible to interact with the icon. The program is crashed possible and I must manually exit from the task manager.