<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Is there a way to debug checkers and BugReporterVisitors? I'm trying to implement a visitor, but having trouble getting it to show any notes.<div><br></div><div>Based on your advice, I tried this:</div><div><br></div><div><div>$ /Users/grubber/src/llvm/tools/clang/tools/scan-build/scan-build --use-analyzer=/Users/grubber/src/llvm-build/Debug+Asserts/bin -v -v -v -enable-checker alpha.cplusplus.BlockRefCapture -enable-checker core --view clang++ -fblocks -std=c++11 blocks.cpp</div><div>sh: /Users/grubber/src/llvm-build/Debug+Asserts/bin: is a directory</div><div>scan-build: Using '/Users/grubber/src/llvm-build/Debug+Asserts/bin' for static analysis</div><div>scan-build: Emitting reports for this run to '/var/folders/fq/4_p48fh50_72j_gt7_pfgn_40000gn/T/scan-build-2013-11-17-184203-37891-1'.</div><div>clang++ -fblocks -std=c++11 blocks.cpp</div><div>scan-build: Removing directory '/var/folders/fq/4_p48fh50_72j_gt7_pfgn_40000gn/T/scan-build-2013-11-17-184203-37891-1' because it contains no reports.</div><div>scan-build: No bugs found.</div></div><div><br></div><div>But that didnt find any issue, so I'm thinking it's not actually trying my alpha checker?</div><div><br></div><div>Jared</div><div><br><div><div>On Nov 14, 2013, at 9:27, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi, Richard. "clang --analyze” is not intended to be a usual interface for the analyzer, merely an invocation that higher-level tools can use. The correct way to run the analyzer, even on a single file, is through the <a href="http://clang-analyzer.llvm.org/scan-build.html">scan-build</a> tool, which provides HTML output that shows you the full path to the purported bug. (Or through Xcode, of course, if you’re on a Mac.)</div><div><br></div><div>Sorry for the inconvenience,</div><div>Jordan</div><div><br></div><br><div><div>On Nov 12, 2013, at 11:56 , Richard <<a href="mailto:legalize@xmission.com">legalize@xmission.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">clang --analyze reports this problem in my code:<br><br>warning: Potential memory leak<br>        for (extent_vector_iter deit = disk_.provided_extents.begin();<br>             deit != disk_.provided_extents.end(); ++deit)<br>                                                   ^~<br>1 warning generated.<br><br>Context:<br><span class="Apple-tab-span" style="white-space:pre">        </span>typedef std::vector<extent_data> extent_vector;<br><span class="Apple-tab-span" style="white-space:pre">     </span>typedef extent_vector::const_iterator extent_vector_iter;<br><br><span class="Apple-tab-span" style="white-space:pre">       </span>extent_data has no raw pointers, only non-pointer POD types and other<br><span class="Apple-tab-span" style="white-space:pre">     </span>standard library classes like string and vector of string, etc.<br><br>The problem with this diagnostic is that it points to the place where<br>it thinks a memory leak may occur, but it doesn't provide me with a<br>chain of reasoning that makes me understand why it thinks this<br>particular chunk of code may leak memory.<br><br>Am I missing some magic flag to tell me this extra level of<br>information, or is that ability simply lacking?<br>-- <br>"The Direct3D Graphics Pipeline" free book <<a href="http://tinyurl.com/d3d-pipeline">http://tinyurl.com/d3d-pipeline</a>><br>     The Computer Graphics Museum <<a href="http://computergraphicsmuseum.org/">http://ComputerGraphicsMuseum.org</a>><br>         The Terminals Wiki <<a href="http://terminals.classiccmp.org/">http://terminals.classiccmp.org</a>><br>  Legalize Adulthood! (my blog) <<a href="http://legalizeadulthood.wordpress.com/">http://LegalizeAdulthood.wordpress.com</a>><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote></div><br></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></div></body></html>