Jump to content

Another debugger for AutoIt


Heron
 Share

Recommended Posts

  • 4 months later...

The last Dbug GUI version doesn't show images and no white button is shown in the Scite left column near the next statement to execute. Maybe it's due to some config. error on my side. BTW, I thought you should know.

in attachment there are screenshots showing different appearance of valdemar1977 and asdf8 versions.

 

Best regards and many thanks for sharing your version.

Peppe

 

screen_20160217_135507.png

Edited by gcriaco
Link to comment
Share on other sites

gcriaco, help me please:

Check the whether you have, after you run debug file

@TempDir & "\dbug.icl"

or

@AppDataDir & "\AutoIt v3\dbug.icl"

if the file exists, it should have checksums:
CRC32: BAF55878
MD5: F14138A10688CD0E10E7EA77D4EBFB78

#Include <Crypt.au3>

If FileExists(@TempDir & "\dbug.icl") Then
    ConsoleWrite('+ Found file :' & @TempDir & "\dbug.icl" & @CRLF)
    $bHash = _Crypt_HashFile(@TempDir & "\dbug.icl", $CALG_MD5)
    If $bHash = '0xF14138A10688CD0E10E7EA77D4EBFB78' Then
        ConsoleWrite('+ Hash Ok' & @CRLF)
    Else
        ConsoleWrite('+ Hash Bad' & @CRLF)
    EndIf
ElseIf FileExists(@AppDataDir & "\AutoIt v3\dbug.icl") Then
    ConsoleWrite('+ Found file :' & @AppDataDir & "\AutoIt v3\dbug.icl" & @CRLF)
    $bHash = _Crypt_HashFile(@AppDataDir & "\AutoIt v3\dbug.icl", $CALG_MD5)
    If $bHash = '0xF14138A10688CD0E10E7EA77D4EBFB78' Then
        ConsoleWrite('+ Hash Ok' & @CRLF)
    Else
        ConsoleWrite('+ Hash Bad' & @CRLF)
    EndIf
Else
    ConsoleWrite('! Not found file "dbug.icl"' & @CRLF)
EndIf

ps: because I do not at all satisfied with functional debugger, will soon be another update.

Link to comment
Share on other sites

Please use ZIP instead RAR when you attach new version.

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

  • 2 weeks later...
On 18.02.2016 at 8:27 PM, asdf8 said:

Update debugger:

  • Changed interface.
  • Fixed detected the errors.
  • Others improvements and additions.

screenshot.png.41566ca3e50641b1a51412117

 

Dbug_2016.02.18.zip

Great work @asdf8!!! Really great...

If you allow, made some suggestions.

1) At the moment _DBUG has an error on #cs ... #ce section of script

My fault, of course we need to put #include <_Dbug.au3> in the first line of the script.

2) Is it possible to implement real OEM console for natural debugging console scripts? (In my version I'm using DbugConsole.exe). StdOut in SciTE console has some problems with encoding and some other features (DBUG_Example.au3).

3) Very low on huge arrays. Not possible to select array columns range. As you know WinAPI can show only 256 columns. But If need to see values of my array after that range?

Problems with window size of Array Viewer.2016-03-03_15-29-20.png.71671e79b76d11cb

In expression list strange value of $i var on script start. ( array.au3)

Need to be a clear.

2016-03-03_15-44-31.png.72f8fb7b456ab6a4

I mean problem is here

For $i = $DBGbtnStep To $DBGbtnStoreList
    GUICtrlSetResizing($i, $GUI_DOCKSIZE + $GUI_DOCKTOP + $GUI_DOCKLEFT)
Next

You can change $i on $_DBUG_i for example,

May be in future change all vars on $_DBUG_varname for excluding any future interfere with script vars?

Edited by valdemar1977
Link to comment
Share on other sites

valdemar1977's Dbug apparently had an unresolved issue with @error macro but F7 and F8 worked correctly and all variables are displayed by default in the watch window which is somewhat interactive. Because of the @error issue I tried asdf8's version.

asdsf8's _Dbug doesn't display any variables in the watch window and when I press F8 when running the included test.au3, instead of single stepping across the first statement it goes straight to line 19 saying "Break in _test(19). F7 works fine but F8 does not single step for me. It behaves as though I had issued a "run to breakpoint" command, except  there are no breakpoints set.

I am unclear as to the purpose of "load and save commands". Can anyone explain how these commands are edited and where are they stored?

Neither of these debuggers now appear to work much like the youtube video referenced in the opening post in this thread so I'm wondering if they don't belong somewhere else?

I am using ver 3.3.14.2 with Dbug2016.02.18.zip. The MD5 for my dbug.icl is AB02F80DBEB12C2A4F24AA9DBA4C3103 which differs from the value mentioned post #86. Does this still matter?

Edited by pseakins
Added version and MD5 details

Phil Seakins

Link to comment
Share on other sites

Looking again at  Dbug2016.02.18 with some other scripts I see that F8, instead of single stepping the current statement, actually causes the code to run full speed until a line with a function call is reached. It then stops on the first executable statement in the function. Hitting F8 once more takes you back to the line following the line that made the function call. I've never seen an IDE behave this way - is this the actual intention? Valdemar1977's version doesn't do this. Can this be fixed?

Also, I have found the debugger fails on source statements that are split over multiple lines with the "_" continuation marker. Is this fixable other than by marking those statements as "do not debug"?

Regardless, it is great to have a debugger like this in AutoIT.

Phil Seakins

Link to comment
Share on other sites

20 hours ago, valdemar1977 said:

At the moment _DBUG has an error on #cs ... #ce section of script

How can I reproduce this error?

20 hours ago, valdemar1977 said:

Is it possible to implement real OEM console for natural debugging console scripts? (In my version I'm using DbugConsole.exe). StdOut in SciTE console has some problems with encoding and some other features (try attached script as an example).

This is a special case of another problem. There also includes debugging scripts using PE-resources from the compiled applications, debugging script running as a service, debug interprocess communication scripts, etc. All this can be solved by debugging compiled script. The next version will have the opportunity to add to the source code debugger, which can then compile and debug in real conditions of use.

9 hours ago, pseakins said:

_Dbug doesn't display any variables in the watch window

Browse the list is disabled by default, this speeds up the work of the debugger, if the script is paused variables can be viewed directly in the editor by placing the mouse over them, if you move the cursor to an empty list of variables appears tooltip - To automatically update expressions list, toggle button "Clear expressions list".

9 hours ago, pseakins said:

when I press F8 when running the included test.au3, instead of single stepping across the first statement it goes straight to line 19 saying "Break in _test(19

F8 - "Step Over Scope", first scope was a "Global", reaching 19 line steel in scope function "_test", the scope has changed - debugger stood pause.

9 hours ago, pseakins said:

I am unclear as to the purpose of "load and save commands". Can anyone explain how these commands are edited and where are they stored?

Edit commands and expressions in the same place where they are displayed, saved in the ini-file, next to the script being debugged.

9 hours ago, pseakins said:

I am using ver 3.3.14.2 with Dbug2016.02.18.zip. The MD5 for my dbug.icl is AB02F80DBEB12C2A4F24AA9DBA4C3103 which differs from the value mentioned post #86. Does this still matter?

It concerned the debugger debugging and should not have any value to users.

55 minutes ago, pseakins said:

Also, I have found the debugger fails on source statements that are split over multiple lines with the "_" continuation marker. Is this fixable other than by marking those statements as "do not debug"?

This multi-line construction, during the execution of AutoIt transforms it into a single line, so the breakpoint is only possible on the first line of this design.

Link to comment
Share on other sites

8 hours ago, pseakins said:

asdsf8's _Dbug doesn't display any variables in the watch window

It is by design. After first start when dbug.ini still not created button "Clear expression list" in the switch On state.

Press it to show expressions, another click will clear all expressions and background of the list will be yellow. For restore default expressions list press "Restore original list" button (with ctrl will restore expressions for all scopes)

8 hours ago, pseakins said:

hen I press F8 when running the included test.au3, instead of single stepping across the first statement it goes straight to line 19 saying "Break in _test(19).

It is by design also. Step over is mean steps to the next line, without descending into any functions called on the current line. F7 - working as line-by-line execution.

8 hours ago, pseakins said:

I am unclear as to the purpose of "load and save commands". Can anyone explain how these commands are edited and where are they stored?

You can manually execute a some commands (for example change value of var or print to console). As an example try ConsoleWrite("It is a test"). You will see It is a test in StdOut console of SciTE. Also you can try to change value for variable in the expressions list, try to change arr $b value in test script ($b[0]="Is New Test"). Use Ctrl+Enter for execute. Display results window show error codes. You can save commands in dbug,ini file pressing "Save commands ..." also you will save a conditional breakpoints.

By the way @asdf8 why by default you put @Error in conditional breakpoints and @Error @Extended in commands? May be they need to be clear on first start?

1 hour ago, pseakins said:

lso, I have found the debugger fails on source statements that are split over multiple lines with the "_" continuation marker

In my case all working great. Can you please provide an example?

Link to comment
Share on other sites

1 hour ago, valdemar1977 said:

In my case all working great. Can you please provide an example?

#include "_Dbug.au3"
$a = 5
$b = 6
$d = 7
If $a = 5 Or _ ; some comment
        $a = 4 Or _ ; another comment
        ($b = 6 And $d = 7) Then
    $a = 5
Else
    $a = 6
EndIf

This example fails with;

"C:\My Documents\AutoIt\Dbug\DbugScript_4.au3" (22) : ==> "If" statements must have a "Then" keyword.:
If $a = 5 Or DBG_GetExtErr()
 

Phil Seakins

Link to comment
Share on other sites

15 minutes ago, pseakins said:
#include "_Dbug.au3"
$a = 5
$b = 6
$d = 7
If $a = 5 Or _ ; some comment
        $a = 4 Or _ ; another comment
        ($b = 6 And $d = 7) Then
    $a = 5
Else
    $a = 6
EndIf

This example fails with;

"C:\My Documents\AutoIt\Dbug\DbugScript_4.au3" (22) : ==> "If" statements must have a "Then" keyword.:
If $a = 5 Or DBG_GetExtErr()
 

Try this one...

#include "_Dbug.au3"
$a = 5
$b = 6
$d = 7
If $a = 5 Or _
        $a = 4 Or _
        ($b = 6 And $d = 7) Then
    $a = 5
Else
    $a = 6
EndIf

 

Link to comment
Share on other sites

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...