Post build commands on win10

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Post build commands on win10

1,831件の閲覧回数
Catosh
Contributor IV

Hello, 

I want to perform static stack analysis as post-build step as BlackNight‌ describes here. Since I am having issues using the "find -name*.o" trick I wrote a python script that looks in the Debug folder, strips the *.o file obtained from the assembly startup file (hardcoded in this moment) ad creates a batch file that launches the perl avstack script. 

I have an env variable that contains the path to my python script(called MYSCRIPT). As Post-build step I provide: 

python ${MYSCRIPT}\recursiveWalktest.py

and everything works fine.

If I concatenate the bat command using the & or && or even ; , everything fails BAD. 

python ${MYSCRIPT}\recursiveWalktest.py & ${CWD}\DoStackAnalysis.bat

/bin/sh: C:UsersUser1[omissis]Project_TemplateDebugDoStackAnalysis.bat: command not found

Any hint on this point would be gladly appreciated.

Script attached for everyone's sake.

B.R:

L.

Edit: probably the backslash near "Outputfiles" would be better as a slah.

Edit2: the previous python script worked fine only with my project, the updated one fits well on the examples from the NXP's SDK.

I had to merge The two bat files just for having a single bat file to run as post-build file.

I am assuming that there is configuration called "Debug".

Placing avstack.pl in the Debug directory of the project allows to run the complete batch script as post build. 

Enabling fstack usage in misc:

pastedImage_1.png

and adding the path as post build script:

pastedImage_2.png

The generated bat file (DoStackAnalysis.bat) can be launched from the folder.

And here comes the issue in my following post BTW.

0 件の賞賛
返信
2 返答(返信)

1,612件の閲覧回数
Catosh
Contributor IV

After some test i was able to identify where the issue is: 

Design studio invokes perl.exe from
C:\NXP\S32DS_ARM_v2018.R1\utils\msys32\usr\bin\

perl.exe -v gives: 

This is perl 5, version 22, subversion 1 (v5.22.1) built for i686-msys-thread-multi-64int

whereas the bat file launched from windows invokes perl.exe from

C:\Perl64\bin\

perl.exe -v gives: 

This is perl 5, version 24, subversion 3 (v5.24.3) built for MSWin32-x64-multi-thread
(with 1 registered patch, see perl -V for more detail)

I can confirm that avstak.pl provides different results. 
WHY this happens, is out of my area of expertise at the moment. adding the path of OS perl to the BAT file solves partially the issue.

Any hint is really appreciated BTW.

B.R.

L. 

0 件の賞賛
返信

1,612件の閲覧回数
Catosh
Contributor IV

Some addition here. 

As a workaround I had to provide two bat files inside a bat file (not exactly what I  was aiming for, but at least is working).

The "awful" thing is that right now the result of the analysis is different if I launch on the bat file or as a postbuild script. 

This looks very strange to me, nevertheless because the post-build scenario provides a maximum height of 1 for EVERY function in the source, the bat launched from windows instead returns bigger heights like 13, 14 and so on. 

Now, I guess the one with bigger Height size is the correct script, but why there is such a difference?

B.R.

Luca. 

0 件の賞賛
返信