Matt_J Posted March 5, 2005 Posted March 5, 2005 (edited) Hi,Just want to propose some changes for AutoIt to allow easier scriptdebugging. There has been a lot of talk in other topics about the needfor debugging features. The changes detailed below are a trace output and a DebugPrint() function. Both of these use the win32 OutputDebugString() to spit messages to adebugger - either Visual Studio, or DebugView from www.sysinternals.com.DebugView can log the debug output to a file and perform remote debugging.Trace output is enabled with AutoItSetOption('DebugOutputEnabled',1)Debug output is generated with DebugPrint($my_var)Output looks something like: test.au3: Line 029: TestFunc2(20) test.au3: Line 044: MsgBox(0, "AutoIt Example", "Inside TestFunc2() - $var is: " & $var) test.au3: Line 045: DebugPrint($var) 20 test.au3: Line 046: EndFuncFiles attached to the post have the test executable, source, test script and output.Based on sources autoit-v3.1.0-src.exeFeedback appreciated. Cheers, Matt_JEdit: Removed code for readabilityAU3_Matt_J_2005_03_05.zip Edited March 5, 2005 by Matt_J Taken a Turing test lately?
DaveF Posted March 5, 2005 Posted March 5, 2005 Matt_J said: ...Output looks something like: test.au3: Line 029: TestFunc2(20) test.au3: Line 044: MsgBox(0, "AutoIt Example", "Inside TestFunc2() - $var is: " & $var) test.au3: Line 045: DebugPrint($var) 20 test.au3: Line 046: EndFunc...Woot! Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.
MHz Posted March 5, 2005 Posted March 5, 2005 With trace, would expanded variables ever be an option with trace? So you can see how the interpreter see the script, like in it's runtime condition? Instead of seeing $var, can we see expanded 'Hello variable contents'. Is this an option for debugging with trace?
Matt_J Posted March 5, 2005 Author Posted March 5, 2005 (edited) Just put something together that loops through the tokens after the lexer() call and spits the variable values one per line. Options are AutoItSetOption('EnableDebugOutput',n) where n=0 no output, n=1 trace output, n=2 trace output with values.Changes are in attached file.Output looks like:test.au3: Line 029: TestFunc2(20)test.au3: Line 044: MsgBox(0, "AutoIt Example", "Inside TestFunc2() - $var is: " & $var)test.au3: Line 044: TRACE $var=20test.au3: Line 045: DebugPrint($var)test.au3: Line 045: TRACE $var=2020test.au3: Line 046: EndFuncEdit: Doesn't work for arrays. There is a whole problem of understanding syntax here for in-place expansion (which side of a variable assignment, function calls, array index etc... too hard basket). Can I suggest just using the DebugPrint() to spit variable values? AU3_Matt_J_2005_03_06.zip Edited March 8, 2005 by Matt_J Taken a Turing test lately?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now