<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="+1">I copied my previous follow-up email below my
signature, which you missed. Here's the full description.</font></p>
<p><font size="+1">The debugging commands are as follows.</font></p>
<p><font size="+1"><tt>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><br>
</tt><tt>(lldb) target create "bin/clang-8"</tt><tt><br>
</tt><tt>Current executable set to 'bin/clang-8' (x86_64).</tt><tt><br>
</tt><tt>(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><br>
</tt><tt><br>
</tt></font></p>
<p><font size="+1"><tt>(lldb) b SimpleStreamChecker.cpp:132</tt><tt><br>
</tt><tt>Breakpoint 1: no locations (pending).</tt><tt><br>
</tt><tt>WARNING: Unable to resolve breakpoint to any actual
locations.</tt><tt><br>
</tt><tt><br>
</tt></font></p>
<p><font size="+1"><tt>(lldb) run</tt><tt>
<<<<<-------- takes about 21 seconds to hit the
breakpoint<br>
Process 26355 launched:
'/home/lu/work/git-repos/llvm/debug-git/bin/clang-8' (x86_64)</tt><tt><br>
</tt><tt>1 location added to breakpoint 1</tt><tt><br>
</tt><tt>Process 26355 stopped</tt><tt><br>
</tt><tt>* thread #1, name = 'clang-8', stop reason = breakpoint
1.1</tt><tt><br>
</tt><tt> frame #0: 0x00007fffec1f0188
libclangStaticAnalyzerCheckers.so.8svn`(anonymous
namespace)::SimpleStreamChecker::checkPostCall(this=0x00000000002c0210,
Call=0x0000000000335c80, C=0x00007fffffff83a8) const at
SimpleStreamChecker.cpp:132</tt><tt><br>
</tt><tt> 129 return;</tt><tt><br>
</tt><tt> 130 </tt><tt><br>
</tt><tt> 131 // Generate the next transition (an edge in
the exploded graph).</tt><tt><br>
</tt><tt>-> 132 ProgramStateRef State = C.getState();</tt><tt><br>
</tt><tt> 133 State =
State->set<StreamMap>(FileDesc,
StreamState::getOpened());</tt><tt><br>
</tt><tt> 134 C.addTransition(State);</tt><tt><br>
</tt><tt> 135 }</tt><tt><br>
</tt></font><font size="+1"><br>
</font></p>
<p><font size="+1">where clang-8 is built by using the following CMake
configuration (and make clang):</font></p>
<p><tt><font size="+1">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>
</font></tt></p>
<p><br>
</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>
</div>
<blockquote type="cite"
cite="mid:ff3cb898-e521-7d11-bd39-c01acc9c5383@gmail.com">
<p><font size="+1">My simplified test case file only contains one
function, with others commented out.<br>
</font></p>
<p><font size="+1">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><font size="+1">I already used gdb-add-index to the clang
executable file.<br>
</font></p>
<p><font size="+1">Any other method might help?<br>
</font></p>
<p><font size="+1">How much time does it take you to stop at a
breakpoint in a checker?<br>
</font></p>
<pre class="moz-signature" cols="72">Love,
Lou
</pre>
</blockquote>
<br>
<div class="moz-cite-prefix">On 10/03/2018 11:12 AM, George
Karpenkov wrote:<br>
</div>
<blockquote type="cite"
cite="mid:2C3E5572-6B1C-421D-9D73-06E775DE3F9E@apple.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
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><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>
</body>
</html>