<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">That’s weird.<div class="">It takes about 1-2 seconds for me.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 3, 2018, at 11:44 AM, Lou Wynn <<a href="mailto:lewisurn@gmail.com" class="">lewisurn@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class=""><p class=""><font size="+1" class="">I copied my previous follow-up email below my
signature, which you missed. Here's the full description.</font></p><p class=""><font size="+1" class="">The debugging commands are as follows.</font></p><p class=""><font size="+1" class=""><tt class="">llvm/debug-git$ lldb-6.0 -- bin/clang-8 -cc1
-analyze -analyzer-checker=alpha.unix.SimpleStream
../src-git/tools/clang/test/Analysis/simple-stream-checks.c</tt><tt class=""><br class="">
</tt><tt class="">(lldb) target create "bin/clang-8"</tt><tt class=""><br class="">
</tt><tt class="">Current executable set to 'bin/clang-8' (x86_64).</tt><tt class=""><br class="">
</tt><tt class="">(lldb) settings set -- target.run-args "-cc1"
"-analyze" "-analyzer-checker=alpha.unix.SimpleStream"
"../src-git/tools/clang/test/Analysis/simple-stream-checks.c"</tt><tt class=""><br class="">
</tt><tt class=""><br class="">
</tt></font></p><p class=""><font size="+1" class=""><tt class="">(lldb) b SimpleStreamChecker.cpp:132</tt><tt class=""><br class="">
</tt><tt class="">Breakpoint 1: no locations (pending).</tt><tt class=""><br class="">
</tt><tt class="">WARNING: Unable to resolve breakpoint to any actual
locations.</tt><tt class=""><br class=""></tt></font></p></div></div></blockquote><div><br class=""></div><div>This is also weird. If lldb replies with “Unable to resolve breakpoint”, it means that, well, it could not resolve the breakpoint.</div><div>And yet it does stop at a breakpoint (much) later on.</div><div><br class=""></div><div>Maybe try a simpler cmake invocation? You customize quite a few things, try just having no customizations at all.</div><div>You write that you have used gdb-add-index, but you should not have to use it.</div><blockquote type="cite" class=""><div class=""><div text="#000000" bgcolor="#FFFFFF" class=""><p class=""><font size="+1" class=""><tt class="">
</tt><tt class=""><br class="">
</tt></font></p><p class=""><font size="+1" class=""><tt class="">(lldb) run</tt><tt class="">
<<<<<-------- takes about 21 seconds to hit the
breakpoint<br class="">
Process 26355 launched:
'/home/lu/work/git-repos/llvm/debug-git/bin/clang-8' (x86_64)</tt><tt class=""><br class="">
</tt><tt class="">1 location added to breakpoint 1</tt><tt class=""><br class="">
</tt><tt class="">Process 26355 stopped</tt><tt class=""><br class="">
</tt><tt class="">* thread #1, name = 'clang-8', stop reason = breakpoint
1.1</tt><tt class=""><br class="">
</tt><tt class=""> frame #0: 0x00007fffec1f0188
libclangStaticAnalyzerCheckers.so.8svn`(anonymous
namespace)::SimpleStreamChecker::checkPostCall(this=0x00000000002c0210,
Call=0x0000000000335c80, C=0x00007fffffff83a8) const at
SimpleStreamChecker.cpp:132</tt><tt class=""><br class="">
</tt><tt class=""> 129 return;</tt><tt class=""><br class="">
</tt><tt class=""> 130 </tt><tt class=""><br class="">
</tt><tt class=""> 131 // Generate the next transition (an edge in
the exploded graph).</tt><tt class=""><br class="">
</tt><tt class="">-> 132 ProgramStateRef State = C.getState();</tt><tt class=""><br class="">
</tt><tt class=""> 133 State =
State->set<StreamMap>(FileDesc,
StreamState::getOpened());</tt><tt class=""><br class="">
</tt><tt class=""> 134 C.addTransition(State);</tt><tt class=""><br class="">
</tt><tt class=""> 135 }</tt><tt class=""><br class="">
</tt></font><font size="+1" class=""><br class="">
</font></p><p class=""><font size="+1" class="">where clang-8 is built by using the following CMake
configuration (and make clang):</font></p><p class=""><tt class=""><font size="+1" class="">cmake -G "Unix Makefiles"
-DLLVM_OPTIMIZED_TABLEGEN=true -DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=ON ../src-git/ -DLLVM_USE_LINKER=lld-6.0
-DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0
-DLLVM_TARGETS_TO_BUILD=""<br class="">
</font></tt></p><p class=""><br class="">
</p>
<pre class="moz-signature" cols="72">Love,
Lou
</pre>
<div class="moz-cite-prefix">On 09/28/2018 06:35 PM, Lou Wynn wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:ff3cb898-e521-7d11-bd39-c01acc9c5383@gmail.com" class=""><p class=""><font size="+1" class="">My simplified test case file only contains one
function, with others commented out.<br class="">
</font></p><p class=""><font size="+1" class="">I tried the RelWithDebInfo CMake build type, it
slightly reduced the time to reach the first breakpoint from
21 to 16 seconds when I ran it with lldb command line. But
when I debug clang in vscode, this configuration doesn't stop
at the breakpoint (with the CodeLLDB extension). The Debug
build stops at the breakpoint. Saving 4 seconds on command
line is not useful because setting or canceling a breakpoint
on the command line takes more time for me in the unfamiliar
code base.</font></p><p class=""><font size="+1" class="">I already used gdb-add-index to the clang
executable file.<br class="">
</font></p><p class=""><font size="+1" class="">Any other method might help?<br class="">
</font></p><p class=""><font size="+1" class="">How much time does it take you to stop at a
breakpoint in a checker?<br class="">
</font></p>
<pre class="moz-signature" cols="72">Love,
Lou
</pre>
</blockquote>
<br class="">
<div class="moz-cite-prefix">On 10/03/2018 11:12 AM, George
Karpenkov wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:2C3E5572-6B1C-421D-9D73-06E775DE3F9E@apple.com" class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
Hi Lou,
<div class=""><br class="">
</div>
<div class="">Somehow I haven’t seen your follow up email.</div>
<div class="">Can you describe a full reproducible example?</div>
<div class="">With an exact command line invocation, exact input
file, and exact breakpoint line.</div>
<div class=""><br class="">
</div>
<div class="">George</div>
<div class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Sep 28, 2018, at 2:27 PM, George Karpenkov
via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="" moz-do-not-send="true">cfe-dev@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode:
space; line-break: after-white-space;" class="">Hi Lou,
<div class=""><br class="">
</div>
<div class="">You probably want to only debug the
analysis running on a function you are interested in.</div>
<div class="">-Xclang -analyzer-display-progress</div>
<div class="">shows what functions the analyzer is going
through, and</div>
<div class="">-Xclang -analyze-function “function-name”</div>
<div class="">let’s you select the function (use the
exact name copied from the previous list).</div>
<div class=""><br class="">
</div>
<div class="">You can also try release+debuginfo
configuration if the former is too slow.</div>
<div class="">20 seconds does sound excessive for a
simple test file in any case though, so that is
strange.<br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Sep 28, 2018, at 1:49 PM, Lou
Wynn via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="" moz-do-not-send="true">cfe-dev@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<meta http-equiv="content-type" content="text/html; charset=utf-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class=""><p class=""><font class="" size="+1">Hi,</font></p><p class=""><font class="" size="+1">I'm now
having a question of how to speed up
startup runs of a static analysis checker
in the lldb debugger. It takes about 21
seconds for the debugger to stop at the
first breakpoint at the
SimpleStreamChecker::checkPreCall </font><font class="" size="+1">function when I run the
following command:</font></p>
<pre class=""><font class="" size="+1">lldb-6.0 -- clang-8 -cc1 -analyze -analyzer-checker=alpha.unix.SimpleStream \
test/Analysis/simple-stream-checks.c</font></pre><p class=""><font class="" size="+1">Are there
ways to make it faster? I run many
debugging sessions not only to figure out
how the static analyzer works but also to
debug my first checker. Any time saving
method is appreciated.<br class="">
</font></p>
<pre class="moz-signature" cols="72">--
Love,
Lou
</pre>
</div>
_______________________________________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" class="" moz-do-not-send="true">cfe-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" class="" moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
_______________________________________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" class="" moz-do-not-send="true">cfe-dev@lists.llvm.org</a><br class="">
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br class="">
</div>
</div></blockquote></div><br class=""></div></body></html>