<div dir="ltr"><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">陶征霖</b> <span dir="ltr"><<a href="mailto:zhenglin.taozl@gmail.com" target="_blank">zhenglin.taozl@gmail.com</a>></span><br>Date: 2015-11-20 23:10 GMT+08:00<br>Subject: lldb doesn't work on centos7<br>To: <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><br><br><div dir="ltr"><div style="font-size:14px">Hi,</div><div style="font-size:14px"><br></div><div style="font-size:14px">I build llvm+clang+lldb 3.7.0 from source code on centos7, the build command is "cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DLLVM_LIBDIR_SUFFIX=64", there is no error during building process.</div><div style="font-size:14px"><br></div><div style="font-size:14px">And then I compile following c++ code using command "clang++ -std=c++11 -stdlib=libc++ -lc++abi -g t.cpp":</div><div style="font-size:14px"><div>// t.cpp</div><div>#include <iostream></div><div>using namespace std;</div><div>int main() {</div><div>   string s = "aa";</div><div>   cout << s;</div><div>}</div></div><div style="font-size:14px">Try lldb to debug a.out, found that I can't print string s which shows empty:</div><div style="font-size:14px"><div>lldb a.out</div><div>(lldb) target create "a.out"</div><div>Current executable set to 'a.out' (x86_64).</div><div>(lldb) l</div><div>   4   <span style="white-space:pre-wrap">        </span>int main() {</div><div>   5   <span style="white-space:pre-wrap">  </span>   string s = "aa";</div><div>   6   <span style="white-space:pre-wrap">       </span>   cout << s;</div><div>   7   <span style="white-space:pre-wrap"> </span>}</div><div>(lldb) b 6</div><div>Breakpoint 1: where = a.out`main + 94 at t.cpp:6, address = 0x0000000000400e5e</div><div>(lldb) r</div><div>Process 150 launched: '/root/a.out' (x86_64)</div><div>Process 150 stopped</div><div>* thread #1: tid = 150, 0x0000000000400e5e a.out`main + 94 at t.cpp:6, name = 'a.out', stop reason = breakpoint 1.1</div><div>    frame #0: 0x0000000000400e5e a.out`main + 94 at t.cpp:6</div><div>   3   <span style="white-space:pre-wrap">     </span>using namespace std;</div><div>   4   <span style="white-space:pre-wrap">  </span>int main() {</div><div>   5   <span style="white-space:pre-wrap">  </span>   string s = "aa";</div><div>-> 6   <span style="white-space:pre-wrap">      </span>   cout << s;</div><div>   7   <span style="white-space:pre-wrap"> </span>}</div><div>(lldb) p s</div><div>(std::__1::string) $0 = {}</div></div><div style="font-size:14px"><br></div><div style="font-size:14px">Could you please help point out what's wrong in my env? Thanks.</div><div style="font-size:14px"><br></div><div style="font-size:14px">Thanks,</div><div style="font-size:14px">Zhenglin</div>
</div>
</div></div>