FaceBook/infer-Debug模式 - D.Q的专栏 - 博客频道 - CSDN.NET
--debug或--frontend_debug --debug
例如我们用debug模式分析iOS项目:
infer --debug -i -- xcodebuild -target HelloWorldApp -configuration Debug -sdk iphonesimulator
Starting analysis (Infer version v0.1.0) make -k -j 4 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/InferAnalyze -allow_specs_cleanup -models /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar -developer_mode -html -dotty -print_types -trace_error -project_root /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello -results_dir '/Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/infer-out' -cluster xcl1.cluster >cl1 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/InferAnalyze -allow_specs_cleanup -models /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar -developer_mode -html -dotty -print_types -trace_error -project_root /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello -results_dir '/Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/infer-out' -cluster xcl3.cluster >cl3 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/InferAnalyze -allow_specs_cleanup -models /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar -developer_mode -html -dotty -print_types -trace_error -project_root /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello -results_dir '/Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/infer-out' -cluster xcl4.cluster >cl4 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/InferAnalyze -allow_specs_cleanup -models /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar -developer_mode -html -dotty -print_types -trace_error -project_root /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello -results_dir '/Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/infer-out' -cluster xcl2.cluster >cl2 echo "Analysis done" Analysis done 4 files analyzed /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/AppDelegate.m:20: error: MEMORY_LEAK memory dynamically allocated to shadowPath by call to CGPathCreateWithRect() at line 20, column 28 is not reachable after line 20, column 5 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/AppDelegate.m:25: error: RESOURCE_LEAK resource acquired to fp by call to fopen() at line 25, column 8 is not released after line 25, column 5 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/AppDelegate.m:29: warning: PARAMETER_NOT_NULL_CHECKED Parameter callback is not checked for null, there could be a null pointer dereference: pointer callback could be null and is dereferenced at line 29, column 5 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/AppDelegate.m:34: error: NULL_DEREFERENCE pointer str last assigned on line 33 could be null and is dereferenced at line 34, column 12 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/AppDelegate.m:39: error: PREMATURE_NIL_TERMINATION_ARGUMENT pointer str last assigned on line 38 could be nil which results in a call to arrayWithObjects: with 1 arguments instead of 3 (nil indicates that the last argument of this variadic method has been reached) at line 39, column 12 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/Hello.m:20: error: NULL_DEREFERENCE pointer hello last assigned on line 19 could be null and is dereferenced at line 20, column 12 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/Hello.m:25: warning: IVAR_NOT_NULL_CHECKED Instance variable hello -> _hello is not checked for null, there could be a null pointer dereference: pointer ret_hello last assigned on line 24 could be null and is dereferenced at line 25, column 12 /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/Hello.m:30: warning: PARAMETER_NOT_NULL_CHECKED Parameter hello is not checked for null, there could be a null pointer dereference: pointer ret_hello last assigned on line 29 could be null and is dereferenced at line 30, column 12 输出的过程会有更多更详细的洗漱打印出来,且在结果目录下会生成更多的文件,多出来一些.dot和.html后缀的文件.
Read full article from FaceBook/infer-Debug模式 - D.Q的专栏 - 博客频道 - CSDN.NET
No comments:
Post a Comment