[cfe-dev] Can Clang Static Analyzer's plist output include the file path?

Aditya Kumar hiraditya at codeaurora.org
Mon Aug 5 09:00:13 PDT 2013


If I understand correctly, you want the file names of the source files in
the report-*.plist to refer to correct source file,

even if there are multiple file names having the same names as long as they
are in different directories.

 

I ran scan-build for a test file using commands:

scan-build -plist -v clang++ -c test.cpp

and in the output .plist file the file name is : "<string>test.cpp</string>"

 

And when I ran,

scan-build -plist -v clang++ -c ../test/test.cpp

In the output report-*plist file the file name is
"<string>../test/test.cpp</string>"

 

I can think of two methods to get what you want.

1.       If the build system passes the file name prepended with path to the
clang front end the reports in the report-*.plist would have distinct file
names. Sometimes build system change directories and then invokes the
compiler. In that case, the compiler and hence the scan-build, will not know
the full path of the file from the source tree.

2.       You can write a small post-process function which parses all the
plist files and prepends all file names with paths from source tree.

 

hth,

-Aditya

 

 

From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On
Behalf Of Chris Ellsworth
Sent: Saturday, August 03, 2013 12:07 AM
To: cfe-dev at cs.uiuc.edu
Subject: [cfe-dev] Can Clang Static Analyzer's plist output include the file
path?

 

I'm looking to ingest the source of an application along with the Static
Analyzer's output (scan-build -plist make) for that source. Plist seems like
the logical output format since the report will be read programmatically,
but I'm worried because it only shows file names, not paths. If there are
two files within a source tree with the same name, it will be difficult to
tell which plist goes with which file. Is there a way to get the path to the
file in the plist, maybe similar to the way it is presented in the HTML
output (relative to the directory that scan-build ran from)?

 

Thanks,

Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130805/0d67e550/attachment.html>


More information about the cfe-dev mailing list