Jump to content

Another debugger for AutoIt


Heron
 Share

Recommended Posts

On 3/9/2016 at 3:41 AM, ISI360 said:

Just for the records: This Debugger is already included in the ISN AutoIt Studio. (Tools -> Debugging -> Advanced Debugging with DBUG)

 

On 3/9/2016 at 3:59 AM, valdemar1977 said:

Hi, @ISI360.

In fact not this one, but original version of DBUG by @Heron, with small modifications by @pandel.

https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?page=2#comment-1090579

 

Thanks for all the hard work!

Try to forgive me for my stupidity, but I'm afraid I'm not clear on how to use either _debug.au3 posted above -OR- the DBUG embedded with ISN AutoIt Studio.  When I try to use the former by adding "#include <_dbug.au3>" and run my script, that _dbug shows a control window, but no actual code is shown and I have no idea how to set breakpoints or otherwise monitor my script's code.  On the other hand, when I try to use the latest ISN AutoIt Studio, I can see my code and I can set breakpoints, but whenever I try to actually start the script I always get the error message: "Debug script could not be created!"

Would someone be so kind as to help me figure these things out?

Another question is: Can I upgrade the debugger embedded in ISN AutoIt Studio to use the latest version posted above, or are the two incompatible?  If it is possible to upgrade ISN AutoIt Studio to use the latest version, what's the best way of doing that?

 

Thanks!

Link to comment
Share on other sites

  • 3 weeks later...
On 17.10.2016 at 11:33 PM, Mbee said:

 

 

Thanks for all the hard work!

Try to forgive me for my stupidity, but I'm afraid I'm not clear on how to use either _debug.au3 posted above -OR- the DBUG embedded with ISN AutoIt Studio.  When I try to use the former by adding "#include <_dbug.au3>" and run my script, that _dbug shows a control window, but no actual code is shown and I have no idea how to set breakpoints or otherwise monitor my script's code.  On the other hand, when I try to use the latest ISN AutoIt Studio, I can see my code and I can set breakpoints, but whenever I try to actually start the script I always get the error message: "Debug script could not be created!"

Would someone be so kind as to help me figure these things out?

Another question is: Can I upgrade the debugger embedded in ISN AutoIt Studio to use the latest version posted above, or are the two incompatible?  If it is possible to upgrade ISN AutoIt Studio to use the latest version, what's the best way of doing that?

 

Thanks!

Hi @Mbee.

Sorry for delay in answer. Original DBUG was designed to using with Scite4Autoit3 or other code editors based on Scite. Please try to start your script in standard Autoit3 editor with including #include <_dbug.au3>. When the main DBUG window is appear in Scite4Autoit3 window with your source code try to put break point and then press start in DBUG GUI.

About upgrade ISN AutoIt Studio debugger with latest DBUG, please address this question to @ISI360 who is a developer of ISN Autoit Studio. Source code of DBUG is available. 

Edited by valdemar1977
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

Hi, all. Does anybody help me? I tried to debug a code in a separate file (test2.au3 in my example), but when I pressed F7 the whole code is made without break.  No matter whether I put #include "_dbug.au3" in test2.au3 or not. I use SCITE 3.3.7 and autoit3 v. 3.3.8.1.  _Dbug version is 2016.06.24.

What I do wrong? I tried to find a solution in forum but without a success. Test1 is a main file.

Best regards.

test2.au3

test1.au3

Edited by zbigj
Link to comment
Share on other sites

  • Developers
3 hours ago, zbigj said:

I tried to debug a code in a separate file (test2.au3 in my example), but when I pressed F7 the whole code is made without break.

Not sure what this means and what you are asking, but F7 ONLY compiles all sources into a target script.exe.
What exactly are you trying to accomplish?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

3 hours ago, Jos said:

Not sure what this means and what you are asking, but F7 ONLY compiles all sources into a target script.exe.
What exactly are you trying to accomplish?

Jos

Thanks for a quick reply. I tried to debug my au3 file. I mean, that when I'm in Scite with test1.au3 opened and active window and press F5 (not F7 now) I go to dbug - window of dbug opens and everything works fine. Now I pressed F7 and I cannot  go into test2.au3 file, which is in the same directory as test1 and this is also a directory when _dbug.au3 exists, I cannot debug the test2 function :( I inserted there break (blue dot - Ctrl-F2) but neither this not F7 doesn't want to stop in included file.

Edited by zbigj
Link to comment
Share on other sites

  • Developers

Why do you expect running test2.au3 would do anything?

#include "_dbug.au3"
Func test2()
   MsgBox(0,'Hi there!','Great debugger !')
EndFunc

It doesn't do anything so will end immediately.

Test1.au3 however does include test2.au3 and then starts Func test2(), so will show something.

#include "_dbug.au3"
#include <test2.au3>

test2()

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

17 hours ago, zbigj said:

Thanks for a quick reply. I tried to debug my au3 file. I mean, that when I'm in Scite with test1.au3 opened and active window and press F5 (not F7 now) I go to dbug - window of dbug opens and everything works fine. Now I pressed F7 and I cannot  go into test2.au3 file, which is in the same directory as test1 and this is also a directory when _dbug.au3 exists, I cannot debug the test2 function :( I inserted there break (blue dot - Ctrl-F2) but neither this not F7 doesn't want to stop in included file.

Hi @zbigj

_dbug cannot debug in include files try to use

#include "_dbug.au3"


test2()

Func test2()
   MsgBox(0,'Hi there!','Great debugger !')
   sleep 1      ; Put breakpoint here
EndFunc

 

Link to comment
Share on other sites

11 minutes ago, valdemar1977 said:

Hi @zbigj

_dbug cannot debug in include files try to use

#include "_dbug.au3"


test2()

Func test2()
   MsgBox(0,'Hi there!','Great debugger !')
   sleep 1      ; Put breakpoint here
EndFunc

 

And this is the answer... I made software in AutoIt3 which is several thousand lines long, divided into many include files.  It's impossible to have all in one single file, I made a library which I uses in many programs - there is no sense to repeat the same code, just for debugging :(

 

Thanks for explaination.

Link to comment
Share on other sites

21 hours ago, Jos said:

Why do you expect running test2.au3 would do anything?

#include "_dbug.au3"
Func test2()
   MsgBox(0,'Hi there!','Great debugger !')
EndFunc

It doesn't do anything so will end immediately.

Test1.au3 however does include test2.au3 and then starts Func test2(), so will show something.

#include "_dbug.au3"
#include <test2.au3>

test2()

Jos

The main file is test1.au3. I tried to make an example as simple as possible and ask it there is a possibility to debug code in include files - that's why I made test1 and test2.au3. Valdemar1970 asked that there is no chance to debug in test2 (include file) and all my hope disappeared :(

Thanks for reading and try to solve my problem. 

Link to comment
Share on other sites

14 hours ago, zbigj said:

And this is the answer... I made software in AutoIt3 which is several thousand lines long, divided into many include files.  It's impossible to have all in one single file, I made a library which I uses in many programs - there is no sense to repeat the same code, just for debugging :(

 

Thanks for explaination.

Don't panic :) . In future version I'm planing to add a keyword for _dbug that will stop execution after that keyword.

Edited by valdemar1977
Link to comment
Share on other sites

22 hours ago, valdemar1977 said:

Don't panic :) . In future version I'm planing to add a keyword for _dbug that will stop execution after that keyword.

In include files? You 'll save my life :)) Would very, very appreciate this :)

 

Link to comment
Share on other sites

2 hours ago, zbigj said:

In include files? You 'll save my life :)) Would very, very appreciate this :)

 

At the moment for debug purposes you can use Au3stripper for merge all recources (includes) to one main script file.

Command is C:\Program Files (x86)\AutoIt3\SciTE\au3Stripper\AU3Stripper.exe <main_au3_file> /mo

/mo - meant Merge Only (other stripper parameters you can find in docs).

After stripping you can found a stripped file in the same dir as the source.

Open it in editor and add #include "_dbug.au3" at the include section of stripped file, then start it with F5 to debug.

Edited by valdemar1977
Link to comment
Share on other sites

On 22.02.2017 at 9:05 PM, valdemar1977 said:

At the moment for debug purposes you can use Au3stripper for merge all recources (includes) to one main script file.

Command is C:\Program Files (x86)\AutoIt3\SciTE\au3Stripper\AU3Stripper.exe <main_au3_file> /mo

/mo - meant Merge Only (other stripper parameters you can find in docs).

After stripping you can found a stripped file in the same dir as the source.

Open it in editor and add #include "_dbug.au3" at the include section of stripped file, then start it with F5 to debug.

Yes, I try to do in this way, some minor problems :)) Thank you for suggestion.

Regards

Link to comment
Share on other sites

On 25.02.2017 at 8:24 PM, zbigj said:

Yes, I try to do in this way, some minor problems :)) Thank you for suggestion.

Regards

Hi, @zbigj.

Workaround for debugging include files is:

  1. Open your Main au3 file and found #include section
  2. Split includes on two parts - your own includes files and standard Autoit UDFs (and/or UDFs that you don't want to debug)
  3. Comment all includes that you do not need to debug and save file.
  4. Run au3stripper with /mo parameter  "C:\Program Files (x86)\AutoIt3\SciTE\au3Stripper\AU3Stripper.exe" <main_au3_file> /mo
  5. Open stripped au3 file and put all commented includes at the includes section of it, uncomment it and add #include "_dbug.au3"
  6. Start your script on debug with F5 as usually.
Link to comment
Share on other sites

  • 2 weeks later...
On 27.02.2017 at 11:07 AM, valdemar1977 said:

Hi, @zbigj.

Workaround for debugging include files is:

  1. Open your Main au3 file and found #include section
  2. Split includes on two parts - your own includes files and standard Autoit UDFs (and/or UDFs that you don't want to debug)
  3. Comment all includes that you do not need to debug and save file.
  4. Run au3stripper with /mo parameter  "C:\Program Files (x86)\AutoIt3\SciTE\au3Stripper\AU3Stripper.exe" <main_au3_file> /mo
  5. Open stripped au3 file and put all commented includes at the includes section of it, uncomment it and add #include "_dbug.au3"
  6. Start your script on debug with F5 as usually.

Thank you, it explain me a lot and save a time. Simple, and there is no need to discover it myself.

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...

Had to do 1 modification to _Dbug.au3, namely adding var $DBG_tabSet to a Global statement.
 

Quote

"C:\Program Files (x86)\AutoIt3\Include\_Dbug.au3"(244,47) : warning: $DBG_tabSet possibly not declared/created yet

It does not occur in the supplied examples because the #Include "_Dbug.au3" is before the Opt('MustDeclareVars', 1).

Excellent tool. Thank you very much.

Btw; I'm running v3.3.14.5

Edited by GordonShumway
Link to comment
Share on other sites

  • 4 weeks later...

there is  12 warning(s) reported by Au3Check

Try this following settings to see what I mean

; AU3Check settings
#AutoIt3Wrapper_Run_AU3Check=Y
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...