Jump to content

Search the Community

Showing results for tags 'debug'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 16 results

  1. cDebug.au3

    Version 1.15.3

    285 downloads

    cDebug.au3 includes four main debugging UDFs: _GuiDebug(), _ConsDebug(), _ClipDebug() and _FormatValsForDebug(). They all dump the values of all AutoIt subtypes and expressions, in a structured manner, including nested arrays (up to 3 dimensions) and slices of them, and even DLL structs and maps. It is an alternative to a graphical debugger, offering GUI output. The format for calling the UDFs has been designed to make coding a call as convenient and fast as possible, minimizing coding effort and the chances of errors: the $name argument is often the same as the variables arguments, enclosed in quote marks. For DLL structures, if you specify a tag, cDebug checks for differences between it and what it detects. If you only specify a structure variable, it can report the structure it detects, with the values of elements. It does much more than MsgBox(), ConsoleWrite() and _ArrayDisplay(), in a definitely user-friendly manner, and does its best to avoid hiding your code in SciTE. #include cDebug no maps.au3 or cDebug.au3 at the top of your script. If you #include cDebug.au3 (the version with maps) #include #AutoIt3Wrapper_Version=B before #include cDebug.au3 It is fully documented in cDebug.pdf . During debugging and development of new features, the current version is used to debug the upcoming version, so there is much testing, even so bugs are always possible, particularly in new features, such as reporting elements of maps whose keys match a regular expression. Bug reports and suggestions are welcome. These UDFs have been in regular use for some years. Because when cDebug was developed, maps were a use at your own risk feature, there are two streams of cDebug: cDebug.au3 reports maps, so to use it you must be running a version of AutoIt that supports maps, e.g. 3.3.15.0, and #include cDebug.au3 cDebug no maps.au3 does not report maps, so you can be running any recent version of AutoIt, e.g. 3.3.14.5, and #include cDebug no maps.au3 The only difference between the two streams is that map-reporting code is commented out in cDebug no maps.au3 . A teaser This script: #AutoIt3Wrapper_Version=B ; beta 3.3.15.0 or greater is mandatory for cDebug.au3 #include "cDebug.au3" Local $seasons[] $seasons.summer = 'May to September' $seasons.spring = 'April' $seasons.fall = 'October to November' $seasons.winter = 'December to March' Local $aCats[3][3] = [['jack','black',3],['suki','grey',4],[$seasons,'','']] Local $i = 1 Local $tStruct = DllStructCreate('uint') DllStructSetData($tStruct,1,2018) _GuiDebug('At line '&@ScriptLineNumber,'$cats,jack is,$cats[..][$i],$i,hex,structure{uint}', _ $aCats,$aCats[0][2],$aCats,$i,Hex(-$i),$tstruct) produces: Edit history See documentation PDF Acknowledgements Melba23, Kafu, ProgAndy, jchd
  2. cDebug.au3 includes four main debugging UDFs: _GuiDebug(), _ConsDebug(), _ClipDebug() and _FormatValsForDebug(). They all dump the values of all AutoIt subtypes and expressions, in a structured manner, including nested arrays and slices of them, and even DLL structs and maps. It is an alternative to a graphical debugger, offering GUI output. The format for calling the UDFs has been designed to make coding a call as convenient and fast as possible, minimizing coding effort and the chances of errors: the $name argument is often the same as the variables arguments, enclosed in quote marks. For DLL structures, if you specify a tag, cDebug checks for differences between it and what it detects. If you only specify a structure variable, it can report the structure it detects, with the values of elements. It does much more than MsgBox(), ConsoleWrite() and _ArrayDisplay(), in a definitely user-friendly manner, and does its best to avoid hiding your code in SciTE. It is fully documented. During development of new features, the current version is used to debug the upcoming version, so there is much testing. These UDFs have been in regular use for some years. Suggestions and bug reports are most welcome. Get the latest version in Example Scripts #AutoIt3Wrapper_Version=B ; beta 3.3.15.0 or greater is mandatory for cDebug.au3, not for cDebug no maps.au3 #include "cDebug.au3" Local $seasons[] $seasons.summer = 'May to September' $seasons.spring = 'April' $seasons.fall = 'October to November' $seasons.winter = 'December to March' Local $aCats[3][3] = [['jack','black',3],['suki','grey',4],[$seasons,'','']] Local $i = 1 Local $tStruct = DllStructCreate('uint') DllStructSetData($tStruct,1,2018) _GuiDebug('At line '&@ScriptLineNumber,'$cats,jack is,$cats[..][$i],$i,hex,structure{uint}', _ $aCats,$aCats[0][2],$aCats,$i,Hex(-$i),$tstruct) reports  
  3. Debug

    Hi, having an issue with an application i did, seems to crash randomly, and can take hours to do so. Simply says in the error msgbox: AutoIt Error Line 16392 (whatevermyapppath.exe) Error: The requested action with this object has failed. Recent changes to the script include this: ObjGet("winmgmts:\\localhost\root\CIMV2") $oSelect_active_network_cards = $objWMIService.ExecQuery('SELECT ProductName FROM Win32_NetworkAdapter WHERE NetConnectionStatus = 2 OR NetConnectionStatus = 9', "WQL") For $oSelect_active_network_card In $oSelect_active_network_cards $Adapter = $oSelect_active_network_card.ProductName Next Is the only thing i can see that can be related to an "object" This lines run only once at the top of the script. When i run the script itself and wait for a crash, it doesn't, or at least yet i didn't. What do you think this error could be? UPDATE: Runing the script eventually output this: "C:\script.au3" (894) : ==> The requested action with this object has failed.: $oNetwork_cards = $objWMIService.ExecQuery('SELECT BytesReceivedPerSec, BytesSentPerSec FROM Win32_PerfFormattedData_Tcpip_NetworkInterface WHERE name LIKE "' & $Adapter & '"', "WQL") $oNetwork_cards = $objWMIService^ ERROR
  4. debug

    Anyone knows how to download the graphical autoitdebugger The download appears to have upped and died. Or an alternative?
  5. When an error occurs in a compiled script, the line number where the error occurred does not match. I noticed that blank lines and lines with only comments are ignored. in the attached example, it is advised that the error occurred on line 2, although in line 4. How to make it warned the correct line? teste.au3
  6. Version 2018.05.24

    853 downloads

    Dbug is graphical debugger for AutoIt. Project started by @Heron in 2009 and now supported by @asdf8 and @valdemar1977. Features Debug the complete script or just parts of it Display run status (line number of currently executed function) GUI default always-on-top in the upper right corner for comfortable debugging WM_NOTIFY and WM_COMMAND hook to prevent interference with possible message handlers Display scope, type and value of variables, expressions, macro's and constants (global AND function local) Execute commands in an immediate window. Can be expressions, functions and assignments Detailed display of array, struct and object variables Dynamic display of variable value in the source code (under cursor) Array table viewer with ability to view the sub-arrays, the correct handling of macro @Error, @Extended and other changes OEM and ANSI console output Conditional breakpoints Saving settings and debugging state and much more... How to use Extract from downloaded archive _Dbug.au3 to your Autoit include dir Add #include <_Dbug.au3> in to your code and run code Before compile or buid comment or remove #include <_Dbug.au3> from your code
  7. Hi, I updated to the last version. Since then a lot of functions are not working. For instance expanding abbreviation. My au3abbrev.properties are correct and abbrev.properties are including both import lines. The abbreviation is red but won't expand. Neither with space nor Ctrl+B. Debug to msgbox and console not working, list functions, jump to function, open include too. SciTE Jump works. Block and box comment too. I have the feeling all functions especially for autoit are not working. Any help? Regards, Conrad
  8. Hello, I am back once again to ask for assistance. I am just trying to fool around with the "ImageSearch" function in order to detect when certain elements appear on my active window to then respond to. To begin testing this I simply cut out a small segment of my background, saved it as a BMP, and used that as the bmp for the search function. I had hoped for it to just run through quickly and say it found it and spit out the X Y coords of where it was found. Instead I am getting this : http://screencast.com/t/MD9aOzPhETE Here's my script thus far : #Include <msgBoxConstants.au3> #Include <ImageSearch.au3> global $x = 0 global $y = 0 CheckForImage () Func checkForImage () Local $Search = _ImageSearchArea ('ninjaCheck.bmp', 1, 0, 0, 1366, 768, $x, $y, 100) If $Search = 1 Then MsgBox ($IDOK,"Found",$resultPosition) EndIf EndFunc While 1 Sleep (10) WEnd What I would like assistance with is how do I "Debug" this in order to see where/why it is failing. I've reviewed https://www.autoitscript.com/wiki/FAQ#How_can_I_debug_my_script.3F but I am not entirely sure how to apply the information. If I could get a return on "Hey, this Func or This Line is where I died" , that would be awesome. Any suggestions on how I can tackle this issue? Thank you for your time! -Reiz checkNinja.bmp is " " around it now and it has the same result
  9. Debugging

    How is it possible to debug your code?
  10. i have just upgraded from 3.3.8.1 to 3.3.10.2 (including SciTE4AutoIt 14.04.05.11) this is my code #include <Debug.au3> _DebugSetup("MyTool - Debug", False) ; ... GUIDelete($mywindow) Exit (0) upon program exit there's an annoying windows opening with the message: Please close the "Report Log Window" to exit. after commenting out the first to lines (the #include and the _DebugSetup(...)) the symptom dissapears. i have just read the current documentation for "_DebugSetup". there it mentions: If the "Report Log Window" type is used then the script will end only when closing the report window. so the current behaviour seems to be "as designed". i'm just surprised it was different in earlier versions. even though i don't ever call "_DebugOut(...)" - and hence there will be no debug window - it insists i should close it on program exit.
  11. I all i make simple and stupid debug GUI. you can: - go to next line - go to code breakpoint - run code until selected line - tun code until set line - view var content the program make a script.au3.debug.au3 file with debug function. you can run any script (i think.....) without prepare it Sorry for my bad english NEW version 0.04 - Renamed "STOP" button in "Pause" - Added "Fast jump line" for fast execute code debug.au3 version 0.03 - HotKey - Stop button - Set var button - Get var button debug.au3 version 0.02 - fix bug - support code with _ debug.au3 version 0.01 debug.au3
  12. log4a - A logging UDF

    I routinely need to log information for my scripts. In the past, I've usually just created functions in each script to write to a log file. I also use ConsoleWrite in conjunction with SciTE a lot when I'm trying to debug scripts. After using some logging libraries for other languages (namely NLog (C#) and Java (log4j)) I decided to write a logging UDF for AutoIt. I decided to base it loosely upon the log4j and NLog libaries. I say loosely because this one is not nearly as feature rich as either one of those, but I think it still provides a nice logging interface. What can it do? Output types: Console, File, or Both. Additionally, you can configure the logger to output differently based on whether the script is compiled or not. This way you can output to the console (SciTE) while you're writing a script, and output to a log file when you've compile the script. Log levels: While I don't think it's really necessary to have this many log levels, these are the levels in ascending order of severity: Trace Debug Info Warn Error Fatal Log Filtering: The log can be enabled and disabled. There are also minimum and maximum log levels that can be configured to only show a range of log levels (i.e. a minimum level of warn would not log messages for trace, debug, or info). These filter levels can be overridden when logging a message if the need be. Error Stream: Logging can be configured to write to the stderr (i.e. ConsoleWriteError). When enabled, any log messages at the error level and above will be written to the error stream. Message Format Macros: The logging message format can be customized to your liking using the following macros: ${date} = Long date (i.e. MM/DD/YYYY HH:MM:SS) ${host} = Hostname of local machine ${level} = The current log level ${message} = The log message ${newline} = Insert a newline ${shortdate} = Short date (i.e. MM/DD/YYYY) Available Functions: Configuration Functions _log4a_SetCompiledOutput - Sets the logging output type for the compiled version of the script (Default: $LOG4A_OUTPUT_FILE) _log4a_SetEnable - Enables or disables logging messages (Default: Disabled) _log4a_SetErrorStream - Enables or disables logging of the standard error stream (Default: Enabled) _log4a_SetFormat - Configures the format of logging messages (Default: "${date} ${level} ${message}") _log4a_SetLogFile - Sets the path of the log file (Default: "<ScriptFullPath>.log") _log4a_SetMaxLevel - Configures the maximum log level to process messages (Default: $LOG4A_LEVEL_FATAL) _log4a_SetMinLevel - Configures the minimum log level to process messages (Default: $LOG4A_LEVEL_TRACE) _log4a_SetOutput - Sets the logging output type for the non-compiled version of the script (Default: $LOG4A_OUTPUT_CONSOLE) Logging Functions _log4a_Debug - Logs a message at the debug level _log4a_Error - Logs a message at the error level _log4a_Fatal - Logs a message at the fatal level _log4a_Info - Logs a message at the info level _log4a_Message - Logs a message to the configured outputs _log4a_Trace - Logs a message at the trace level _log4a_Warn - Logs a message at the warn level See the source file for full documentation of available functions. A quick example script: #include "log4a.au3" ; Enable logging and don't write to stderr _log4a_SetEnable() _log4a_SetErrorStream(False) log_messages() ; Write to stderr, set min level to warn, customize message format _log4a_SetErrorStream() _log4a_SetMinLevel($LOG4A_LEVEL_INFO) If @compiled Then _log4a_SetMinLevel($LOG4A_LEVEL_WARN) ; Change the min level if the script is compiled _log4a_SetFormat("${shortdate} | ${host} | ${level} | ${message}") log_messages() ; Disable logging (except for those that override) _log4a_SetEnable(False) log_messages() Func log_messages() _log4a_Trace("A TRACE message", True) ; overrides filters _log4a_Debug("A DEBUG message") _log4a_Info("A INFO message") _log4a_Warn("A WARN message") _log4a_Error("A ERROR message", True) ; overrides filters _log4a_Fatal("A FATAL message") EndFunc Without further adieu, the UDF: log4a.au3
  13. Its been asked before and I can't seem to find any UDF or built in feature with support for Logging in AutoIt, but I thought it wouldn't hurt to ask and spark some focus on the matter. Applications built for in house use to be run by those that develop them really isn't an issue. It becomes useful to troubleshoot an application if it utilizes some sort of Logging. It is feasible to write functions to support such a need, but I would be pleased if I could find someone who is a far better programmer than I had visited this so I don't have to divert attention and implement it into projects. What I'm looking for is something similar to NLog or Log4Net with the ability to log events as they happen for ease of troubleshooting if an application fails. I'm aware of Opt("GUIOnEventMode", 1) but that isn't useful if the end user is not the developer and where screenshots are not desired. I'm not trying to compare Autoit to .NET in any way. I'm just trying to achieve logging capabilities that match those applications mentioned. I have considered AutoItX and recoding the project in .NET except for the components that are essentially AutoIt only capable, but that is a bit extreme for my immediate needs.
  14. Just thinking/working on some source code recursion scanner. (nothing fancy, just a basic potential problem locator/scanner) But I'm kinda at a loss at finding a nice or good way go about is. Steps that passed my mind. - Find all function(definitions) names. [working] - Get hold of function code. (from full source) [working] - Scan function code for calls to other function. [initial scan: working] At this point I got array(s) with: - User-function(def) names. - User-function(unique) call count from that function. (+names of those calls) Here is where I kinda run out of ideas. Probably just need some more time to come up with something ...
  15. ;; suggested filename: "SplitLineMerge.au3" ;; Just run(build) it on it self to test it. (SciTe4AutoIt3) ;; Generally tested. (possible rare exceptions ignored.) ;; ... Not intended to be used on none Obfuscated au3 files. ;; include these 3 lines in your source code. (with <foobar> parts adjusted to your situation.) #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so #AutoIt3Wrapper_Run_After=<Filespec_To_AutoIt3.exe, (not accepting quotes:?)> /AutoIt3ExecuteScript "<Path_To>\SplitLineMerge.au3" "%in%" DebugOut('>Running: Obfuscated_SplitLineMerge, CMD: ' & $CmdLineRaw) If Not $CmdLine[0] Then DebugOut_Exit('!>No CmdLine input.', 1) If Not IsFile($CmdLine[1]) Then DebugOut_Exit('!>Target source file not found.', 3) _SplitLineMerge($CmdLine[1]) Exit Func _SplitLineMerge($sFile_Au3) If StringRight($sFile_Au3, 4) <> '.au3' Then _ DebugOut_Exit('!>Target file not a ".au3" file.', 4) Local $sFile_Source = StringTrimRight($sFile_Au3, 4) & '_Obfuscated.au3' If Not IsFile($sFile_Source) Then _ DebugOut_Exit('!>Target "*_Obfuscated.au3" file not found.', 5) Local $sCode = FileRead($sFile_Source) $sCode = StringReplace($sCode, ' _' & @CRLF, ' ', 0, 2) Local $iCount = @extended Local $sFile_Target = StringTrimRight($sFile_Source, 4) & '_MergedSplitLines.au3' If FileExists($sFile_Target) And Not FileExists($sFile_Target & '\') And Not FileDelete($sFile_Target) Then _ DebugOut_Exit('!>FileDelete "' & $sFile_Target & '" failed.', 6) If Not FileWrite($sFile_Target, $sCode) Then _ DebugOut_Exit('!>FileWrite "' & $sFile_Target & '" failed.', 7) DebugOut('+>"' & $sFile_Target & '" file written, ' & $iCount & ' lines merged.') EndFunc Func IsFile($sFile) Return FileExists($sFile) And Not FileExists($sFile & '\') EndFunc ;; --- Func DebugOut($1, $2 = 'fOObAr') If Not ($2 == 'fOObAr') Then $1 &= ' = ' & String($2) Return ConsoleWrite($1 & @CRLF) EndFunc Func DebugOut_Exit($1, $2 = 0) ConsoleWrite($1 & @CRLF) Exit $2 EndFunc(Edits: Title adjust, Title adjust 2, ...)
  16. _DLLStructDisplay While working on debugging a project a while back, I was looking for better ways to debug the code. And voila, here it is. Anyway, this function displays the contents of your DLLStruct's in a ListView format (placing the items in an array and utilizing _ArrayDisplay). IMPORTANT: You must supply the string EXACTLY as it was used to set up the structure (although you can add descriptions after the datatypes if they aren't already there). The string requirement might seem like one more extra step, but without it the function wouldn't work (and you're debugging would be much harder). The code is smart enough to split items into subitems (based on [#]'s found), and will display the description with {sub item #x}). Also - the behaviour with GINORMOUS pieces of data is unknown - this is best used with smaller structures! NOTE: One thing you might notice about structures is alignment has alot to do with where items are placed in the structure. The default is '8', which means that everything is aligned on a boundary equally divisible by itself (char being 1 byte is aligned anywhere, int's being 4 bytes, are aligned on offsets divisible by 4, double's and int64's both are aligned on offsets equally divisible by 8) HOWEVER: a prefix of 'align ##' can change this behavior so that the data can be 'misaligned' so to speak, to the specified alignment # (see AutoIT Help info for DLLStructCreate) Update Log: Download the ZIP Here Ascend4nt's AutoIT Code License agreement: While I provide this source code freely, if you do use the code in your projects, all I ask is that: If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I creditIf the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking.
×