[cfe-dev] Traces of SVal in BugReporterVisitor
ganna at apple.com
Sat Feb 23 14:47:23 PST 2013
To get more familiar with the code, take a look at BugReporter.cpp::GenerateExtensivePathDiagnostic this is the logic that walks the chain of ExplodedNodes (the path) and constructs PathDiagnostics. You can see how interesting symbols are being used here and also how they get propagated by tracing interesting calculations, similar to what you want(reversePropagateIntererstingSymbols). (However, as I mentioned before, the interesting symbols are only used to prune the uninteresting calls.) You can also see how visitors are called to generate extra notes at the end of each loop iteration. The visitors are defined in BugRreporterVisitor.h. If you look at the implementation of some, you'll see that a visitor tracking a particular region, might register an additional visitor to track a related region.
On Feb 23, 2013, at 2:14 PM, Anna Zaks <ganna at apple.com> wrote:
> On Feb 22, 2013, at 11:52 AM, gerardjubile <shahar.golan.mail at gmail.com> wrote:
>> Thanks for your answers.
>> I really hoped that there is a way to mark the SVal's symbol as interesting
>> will do the trick :(
>> Would implementing this be difficult?
> It will not be trivial from the implementation point - there is no notion of a value being propagated through the analysis path, instead you have a sequence of ExplodedNodes, so you would have to walk the path and examine exploded nodes to see what changed and use heuristics to see if the change is something you should be observing. In addition, it is also not clear what to track. For example, for 'x = a + b' if 'x' is being tracked, should you start tracking 'a' and 'b'? What if the value of 'x' depends on a condition, ex: 'if (c) x = a else x = b', should you start tracking assignments to 'c' as well? Determining what is interesting might require some sort of program slicing solution (http://en.wikipedia.org/wiki/Program_slicing). Also, we do not want to overpower users with too much info.
> I would suggest starting with small incremental improvements. For example, use the existing visitors, which other checkers use. Adding a visitor to the BugReport is as easy as marking a symbol interesting.
> The next step would be to see what is missing and try to enhance those visitors or write your own version, which solves a particular problem - adds a missing node along a path.
>> Could you guide me through this?
>> If it is to complicated for a newbie like me, I will try to follow the
>> example in bugreporter::trackNullOrundefValue.
>> Thanks, Gerard.
>> View this message in context: http://clang-developers.42468.n3.nabble.com/Traces-of-SVal-in-BugReporterVisitor-tp4030520p4030576.html
>> Sent from the Clang Developers mailing list archive at Nabble.com.
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev