Klocwork 作为一款出色的软件静态分析软件,上半年花了段时间了解使用,这里记录下基本使用方法,备忘。
Run Klocwork for firmware code in Linux OS
Take peregrine firmware code for example and the test OS isUbuntu 12.04 LTS 32bit.
Setp 1: Prepare the Klocwork environment.
Install the Klocwork User package on Linux
The Klocwork user package is under the path: \\10.231.198.24\User\EricLiu\klocwork. You can find the 32bit and 64bit package here.
Please refer the link: http://developer.klocwork.com/klocwork-university/cbt/installing-klocwork-user-package-unix to install the user package.
Step 2: Make sure the Linux OS can access the Qualcomm server.
Since the Klocwork analyze needs to Qualcomm license server, we need to make sure the Linux OS can access the Qualcomm server.
What you need to do is to connect an office cable to this Linux OS then openhttp://qualent.qualcomm.com and use your ID/passcode (PIN+6 token numbers) login qualent.
Step 3: Run Klocwork for the firmware code.
All right, let me assume the upper two preparing steps are finished.
a. Switch to root user
b. Set the environment path
c. Using command: kwcheck create – license-hostLicense-wan-klocwork-01.qualcomm.com –license-port 7322
d. kwcheck create result: Make sure the .kwlp and.kwps folders are created, using Show Hidden Files
e. Source and make clobber
f. Using command: kwinject –o target.out make
g. Kwinject result: Make sure the target.outfile is created.
h. Using command: kwcheck import target.out
i. Using command: kwcheck run (the folderpath contains the .sh file)
j. Analyze result