AutoHotkey Community

It is currently May 27th, 2012, 6:25 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: January 4th, 2010, 3:01 am 
Offline

Joined: July 30th, 2005, 3:49 pm
Posts: 42
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 4th, 2010, 10:41 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 4th, 2010, 8:42 pm 
Offline

Joined: July 30th, 2005, 3:49 pm
Posts: 42
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


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 24th, 2011, 10:19 pm 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2011, 10:41 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: To be more specific.
PostPosted: February 25th, 2011, 4:26 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2011, 1:51 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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"


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks
PostPosted: March 1st, 2011, 5:40 pm 
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. :wink: )


Report this post
Top
  
Reply with quote  
PostPosted: March 2nd, 2011, 1:52 am 
Offline

Joined: December 2nd, 2010, 12:25 am
Posts: 73
Location: Ontario, Canada
I am new to Notepad++. I install the DBGp plugin and under Config I set I checked Bypass all mapping (local windows setup)

Image

I set a break point in the script

When I run "AutoHotkey_l /Debug" nothing happens
Image

When I run "AutoHotkey /Debug"
Image

I get this!
Image

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Somewhat working
PostPosted: March 2nd, 2011, 4:28 am 
Offline

Joined: December 2nd, 2010, 12:25 am
Posts: 73
Location: Ontario, Canada
I used this in the run dialog: AutoHotkey /Debug "$(FULL_CURRENT_PATH)"
Image

Now I can get the script to debug and the breakpoint to be hit.

Am I doing this correctly :?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2011, 6:53 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
That's one way to do it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2011, 3:57 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
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?

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 11th, 2011, 10:30 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 11th, 2011, 3:12 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Thanks! I didn't know I had to refresh.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 24th, 2012, 9:03 pm 
Offline

Joined: February 24th, 2012, 8:45 pm
Posts: 2
I've only been using AHK for a couple of days, and am trying to set up a debugging environment with notepad++ as well. I have the DBGp plugin in Notepad++ and the config set as suggested. I open my script with a shortcut which has the /debug switch, and the debugger seems to see it because the "disconnected" in the debug window changes to show the location of the script. I click on the stop sign in the debugging window and a red dot appears in the code in Notepad++ where the cursor is, so I think a breakpoint is being set, at least in Notepad++. Then I hit the key sequence in the script, and the script runs, but it blows right past the breakpoint and gets to a msgbox below it. Some connection is not being made. Does anybody know what I'm doing wrong? Do I need to run it a different way, or with the F5 key or what? Sorry for what's obviously a newbie question, but thanks in advance for any help.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], hd0202 and 60 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group