| View previous topic :: View next topic |
| Author |
Message |
Stanley Krute
Joined: 30 Jul 2005 Posts: 42
|
Posted: Mon Jan 04, 2010 2:01 am Post subject: debugging w/ AutoHotkey_L, DBGp, and Notepad++ |
|
|
Howdy
I followed these instructions to set this up:
| Quote: | Usage:
* Launch Notepad++.
* Show the debugger pane via the toolbar or Plugins, DBGp, Debugger.
* Open the script file to be debugged.
* Set at least one breakpoint.
* Launch AutoHotkey_L /Debug.
* Use the debugger toolbar or shortcut keys to control the debugger. |
My script is test_debug.ahk. I open it up in Notepad++ and set a breakpoint. I open a cmd line at the directory the script is in, and give the command
| Quote: | | autohotkey_l /Debug "test_debug.ahk" |
Notepad++ then opens up a dialog box that says
| Quote: | | Unable to map filename: x:\aaa stan software projects\tests\test_debug.ahk (ip: 127.0.0.1 idekey: ) unix: 1 |
I'm guessing there's some sort of DBGp setup/config step I need to perform. Anyone have any clues ?
thx
-- stan |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Mon Jan 04, 2010 9:41 am Post subject: |
|
|
There's a step I missed when writing the instructions:
Go to Plugins, DBGp, Config... and setup file mapping. If you will be running Notepad++ and AutoHotkey on the same system (i.e. not debugging remotely, over a network), you may simply put a checkmark next to Bypass all mapping (local windows setup). |
|
| Back to top |
|
 |
Stanley Krute
Joined: 30 Jul 2005 Posts: 42
|
Posted: Mon Jan 04, 2010 7:42 pm Post subject: |
|
|
| Lexikos wrote: | There's a step I missed when writing the instructions:
Go to Plugins, DBGp, Config... and setup file mapping. If you will be running Notepad++ and AutoHotkey on the same system (i.e. not debugging remotely, over a network), you may simply put a checkmark next to Bypass all mapping (local windows setup). |
Aha !! Thanks, Lexikos. I thought I'd tried that, and it hadn't worked, but I tried it again, and all is well.
-- stan, happily debugging now |
|
| Back to top |
|
 |
Anon Guest
|
Posted: Thu Feb 24, 2011 9:19 pm Post subject: I know this is quite old but |
|
|
| When I open a command line @ directory of script and run AutoHotkey_L /Debug "scriptname", I get an invalid command error on AutoHotkey_L. Any thoughts? |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Thu Feb 24, 2011 9:41 pm Post subject: |
|
|
| Sounds like there's an error in your script, and the error message would tell you exactly which line it is on. If you need more help, you'll have to be more specific. |
|
| Back to top |
|
 |
Anon Guest
|
Posted: Fri Feb 25, 2011 3:26 pm Post subject: To be more specific. |
|
|
specifics:
I have installed AutoHotkey_L, I have DBGp running in Notepad++.
I right click the directory containing the script, click Open Command Window Here, type AutoHotkey_L /Debug "scriptname", press enter and receive error message: 'AutoHotkey_L' is not recognized as an internal or external command, operable program or batch file. |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Sat Feb 26, 2011 12:51 am Post subject: |
|
|
AutoHotkey_L isn't in the script directory. You need to either specify the full path or add the AutoHotkey directory to the PATH environment variable. (My instructions assume you have a basic understanding of command line usage.)
Instead, I'd suggest running the following, which will give you a simple "Debug Script" option when you right click a script file:
| Code: | RegWrite REG_SZ, HKCR, AutoHotkeyScript\Shell\Debug,, Debug Script
RegWrite REG_SZ, HKCR, AutoHotkeyScript\Shell\Debug\Command,, "%A_AhkPath%" /Debug "`%l" |
|
|
| Back to top |
|
 |
Anon Guest
|
Posted: Tue Mar 01, 2011 4:40 pm Post subject: Thanks |
|
|
You were right, I should pay more attention. The app installed as autohotkey, not autohotkey_l. Of course it wasn't finding it. (I have basic knowledge, but I don't always pay the most attention. ) |
|
| Back to top |
|
 |
AmourSpirit
Joined: 01 Dec 2010 Posts: 67 Location: Ontario, Canada
|
Posted: Wed Mar 02, 2011 12:52 am Post subject: Can not get debug to work Notpad++ |
|
|
I am new to Notepad++. I install the DBGp plugin and under Config I set I checked Bypass all mapping (local windows setup)
I set a break point in the script
When I run "AutoHotkey_l /Debug" nothing happens
When I run "AutoHotkey /Debug"
I get this!
and the script runs and hangs in the background
Can someone please tell me what I am doing wrong.
I am testing this on a script that I know to work.
Win7 Sp1 AHK_L v1.0.92.02 |
|
| Back to top |
|
 |
AmourSpirit
Joined: 01 Dec 2010 Posts: 67 Location: Ontario, Canada
|
Posted: Wed Mar 02, 2011 3:28 am Post subject: Somewhat working |
|
|
I used this in the run dialog: AutoHotkey /Debug "$(FULL_CURRENT_PATH)"
Now I can get the script to debug and the breakpoint to be hit.
Am I doing this correctly  |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Wed Mar 02, 2011 5:53 am Post subject: |
|
|
| That's one way to do it. |
|
| Back to top |
|
 |
Frankie
Joined: 02 Nov 2008 Posts: 2850
|
Posted: Sat Sep 10, 2011 2:57 pm Post subject: |
|
|
How do you view variables and objects while debugging? I can connect, set breakpoints, step through the script and see the stack -- but I don't see the local or global variables. When I try to do eval it gives me an error that reads, "List index out of bounds (0)". I also get that when doing a Run To Cursor.
Thoughts? _________________ aboutscript ⍟ apps ⍟ scripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Sun Sep 11, 2011 9:30 am Post subject: |
|
|
| Quote: | | I don't see the local or global variables. | Do you see an empty "Local context"/"Global context" pane? If not, enable them from the DBGp menu under the Plugins menu. Once they're visible, right click in the pane and you should get a "Refresh" option. You can also add variables to the Watches pane via the context menu. Alternatively, take a look at the "Refresh" options shown in AmourSpirit's screenshot.
| Quote: | | When I try to do eval it gives me an error that reads, "List index out of bounds (0)". I also get that when doing a Run To Cursor. | The DBGp plugin has generally poor error handling for things it expects to always succeed (they probably do with xdebug/php). Eval and Run To Cursor aren't supported by AutoHotkey. |
|
| Back to top |
|
 |
Frankie
Joined: 02 Nov 2008 Posts: 2850
|
Posted: Sun Sep 11, 2011 2:12 pm Post subject: |
|
|
Thanks! I didn't know I had to refresh. _________________ aboutscript ⍟ apps ⍟ scripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run |
|
| Back to top |
|
 |
|