Jump to content

Stripped/missing line


Go to solution Solved by Jos,

Recommended Posts

Hi. With latest tools versions (AutoIt 3.3.10.2 w/ or w/o 3.3.11.5-beta, SciTE 3.4.1), the AU3Stripper removes a true active line which result in creating an error when AU3Check parses the "stripped" file. This problem was encountered at least in two different functions, and the test-case (see attached 7z archive) reproduces this problem with only few code lines.

Error occurs at line 59 in stripped file (attached). Original missing line is "./Processes_Threads_nDLLs/[includes]/_ProcessUndocumented.au3", line 160.

As far as I can see, the stripped will remove (by mistake) the 3rd line if :

   1st line : declarative code with optional return

   2nd line : comment

   3rd line : declarative code (both functions have DllStructCreate, is it a condition for this problem occurs ?)

"Processes_Threads_nDLLs" sub-directory is a public au3 "library".

See more detailed instructions in "ReadMe.txt" (also attached)

Thanks in advance for your support

strip.7z

Edited by jlf
Link to comment
Share on other sites

Where is $stPBI declared? The only place I see it being declared is in the below code, which is a local variable.

Func __PUDGetBasic($hProcess,$iInfo)
    If Not IsPtr($hProcess) Then Return SetError(1,0,-1)
    ; Process_Basic_Info: Exit Status, PEB Base Address, Affinity Mask, Base Priority, Process ID#, Parent Process ID#
    Local $stPBI=DllStructCreate("ulong_ptr;ptr;ulong_ptr;ulong_ptr;ulong_ptr;ulong_ptr") ; <<<<<<<<<<<<<
    __PUDQueryProcess($hProcess,0,DllStructGetPtr($stPBI),DllStructGetSize($stPBI))
    If @error Then Return SetError(@error,@extended,-1)
    Return DllStructGetData($stPBI,$iInfo)
EndFunc

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Developers

Try the latest Beta of au3stripper to see if that fixes the issue (when there is one).

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

Yes, this local variable is declared where you put the "<<<"

Original function :

Func __PUDGetBasic($hProcess,$iInfo)                                                                                     ;line0
    If Not IsPtr($hProcess) Then Return SetError(1,0,-1)                                                                 ;line1
    ; Process_Basic_Info: Exit Status, PEB Base Address, Affinity Mask, Base Priority, Process ID#, Parent Process ID#   ;line2
    Local $stPBI=DllStructCreate("ulong_ptr;ptr;ulong_ptr;ulong_ptr;ulong_ptr;ulong_ptr")                                ;line3
    __PUDQueryProcess($hProcess,0,DllStructGetPtr($stPBI),DllStructGetSize($stPBI))                                      ;line4
    If @error Then Return SetError(@error,@extended,-1)                                                                  ;line5
    Return DllStructGetData($stPBI,$iInfo)
EndFunc

 After AU3Stripper :

Func __PUDGetBasic($hProcess,$iInfo)                                                ;line0
If Not IsPtr($hProcess) Then Return SetError(1,0,-1)                                ;line1
__PUDQueryProcess($hProcess,0,DllStructGetPtr($stPBI),DllStructGetSize($stPBI))     ;line4
If @error Then Return SetError(@error,@extended,-1)                                 ;line5
Return DllStructGetData($stPBI,$iInfo)
EndFunc

Line2 removed (OK, it's a comment), but Line3 shall not be removed...

Edited by jlf
Link to comment
Share on other sites

Try running the script through Tidy before stripping. There was an issue where lines got stripped when the code didn't have the right spacing around the variables and operators.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Jos : OK

BrewManNH : exact, modified source line and it works (others problem later but will try later)

My principal need is in fact having a script were the source line number matches with the "error at line number" when there is a bug in the script. Is there another way ?

Edited by jlf
Link to comment
Share on other sites

  • Developers

Cant look at your source, but when you have mixed /mo with any other option, it definately is a bug in the original distributed au3stripper that could cause issues.

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

Hi. Compiling with latest tools (AutoIt 3.3.11.5 + SciTe 3.4.1) will not update the output file "test_stripped.au3". Source file is "test.au3" and creating an empty file "test_stripped.au3" avoid this output file being updated by AU3Stripper (all others flags are not affected).

See attached 7z archive

Thanks in advance for support

20140507 - stripped_not_updated.7z

Link to comment
Share on other sites

Hi. Compiling with latest tools (AutoIt 3.3.11.5 + SciTe 3.4.1) and "/soi" switch will removed NOT useless functions. These functions are called by "OnAutoItExitRegister" and/or "TrayItemSetOnEvent", but as far I can see AU3Stripper doesn't detect these both function are really called, removed them, and then AU3Check returns errors due to this missing functions.

Test-case(see attached 7z archive) include lots of (empty) functions, but I can't reduce because this will not reproduce this problem.

Thanks in advance for support.

20140507 - MissingFunctions_soi.7z

Link to comment
Share on other sites

  • Developers

Please stop creating threads and answer my last post in your original thread:

Try using the current Beta version to see if that solves it!

Jos

the 3 topics are now merged.

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

Jos : sorry about this, was thinking doing in the good way...

The newest AU3Stripper I see is the 1.2.0.0 (which is already installed & used). You told me about beta script, newer that 1.2.0.0 ?! Where I can find it ?

Edited by jlf
Link to comment
Share on other sites

OK. Just tried with 1.2.0.6 (your link), and :

  1. stripped file is now updated
  2. missing function : unchanged

I was just observating that these both missing functions are called through a string : TrayItemSetOnEvent("MyFunction1") and/or OnAutoItExitRegister("MyFunction2").

Thanks

Link to comment
Share on other sites

  • Developers
  • Solution

Uploaded v 1.2.0.7 to the Beta directory which fixes your issue when using the amount of includes like you do. :)

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

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