Main Content

polyspace-bug-finder-access

(DOS/UNIX) 从 WindowsLinux 或其他命令行运行 Polyspace as You Code

自 R2021a 起

说明

示例

注意

此 Polyspace® 命令在 polyspaceroot\polyspace\bin 中可用。其中,polyspaceroot 是 Polyspace as You Code 安装文件夹,例如 C:\Program Files\Polyspace as You Code\R2024a(另请参阅Run Polyspace as You Code from Command Line and Export Results)。为避免键入此命令的完整路径,请将此位置添加到操作系统中的 PATH 环境变量中。

polyspace-bug-finder-access -sources sourceFile [options] 对源文件 sourceFile 运行 Polyspace as You Code 分析。您可以使用附加选项来自定义分析。

polyspace-bug-finder-access -sources sourceFile -import-comments baselineFolder [options] 对源文件 sourceFile 运行 Polyspace as You Code 分析,然后导入存储在 baselineFolder 中的上一次运行的审查信息。请参阅 -import-comments (Polyspace Bug Finder)

使用此工作流可将您的结果与从 Polyspace Access 下载的上一次运行的结果进行比较,然后仅关注新结果或未经审查的结果。请参阅在命令行中设置基线 Polyspace as You Code 结果

示例

polyspace-bug-finder-access -sources sourceFile -options-file optFile 使用选项文件中指定的选项对源文件 sourceFile 运行 Polyspace as You Code 分析。同样,当您有许多分析选项时,使用选项文件可以更轻松地运行相同的分析。

polyspace-bug-finder-access -h[elp] 列出可能的分析选项的汇总。

示例

全部折叠

通过直接在命令行中指定所有选项来运行 polyspace-bug-finder-access 命令。

对当前文件夹中的单个源文件 file.c 运行 polyspace-bug-finder-access 命令。将结果保存在文件夹 polyspaceResults 中。

polyspace-bug-finder-access -sources file.c -results-dir polyspaceResults

通过在文本文件中指定选项来运行 polyspace-bug-finder-access 命令。

在文本文件 opts.txt 中输入以下内容:

-results-dir polyspaceResults
-compiler gnu7.x

对当前文件夹中的单个源文件 file.c 运行 polyspace-bug-finder-access 命令。使用之前创建的文件 opts.txt 中的分析选项:

polyspace-bug-finder-access -sources file.c -options-file opts.txt

输入参数

全部折叠

C 或 C++ 源文件名称,指定为字符串。如果该文件不在当前文件夹 (pwd) 中,则 sourceFile 必须包含完整路径或相对路径。为避免因路径带有空格而导致错误,请在路径两端加上引号 " "。有关详细信息,请参阅 -sources (Polyspace Bug Finder)

请注意,使用 Polyspace as You Code 一次只能分析单个源文件。

示例: myFile.c

分析选项及其对应的值,由选项名称和值(如果适用)指定。有关语法规范,请参阅各个分析选项参考页面 (Polyspace Bug Finder)

示例: -lang C-CPP -compiler diab

列出分析选项和值的文本文件,指定为字符串。如果该文件不在当前文件夹 (pwd) 中,则 optFile 必须包含完整路径或相对路径。为避免因路径带有空格而导致错误,请在路径两端加上引号 " "。有关详细信息,请参阅 -options-file (Polyspace Bug Finder)

示例: opts.txt, "C:\ps_analysis\options.txt"

存储从 Polyspace Access 下载的运行的文件夹路径。您可以将下载的运行用作 Polyspace as You Code 运行的基线。请参阅在命令行中设置基线 Polyspace as You Code 结果

示例: "C:\Temp\Results_Folder\baseline"

版本历史记录

在 R2021a 中推出