<div dir="ltr"><div><div>Hi Pavel,<br><br></div><div>Thanks for your reply. Seems lldb not finding the variable in the first place.<br><br>* thread #1: tid = 154, 0x0000000000400e5e a.out`main + 94 at t.cpp:5, name = 'a.out', stop reason = breakpoint 1.1<br> frame #0: 0x0000000000400e5e a.out`main + 94 at t.cpp:5<br> 2 using namespace std;<br> 3 int main() {<br> 4 string s = "aa";<br>-> 5 cout << s;<br> 6 }<br>(lldb) frame variable --raw-output s<br>(std::__1::string) s = {}<br></div><div><br></div><div>I added -fno-limit-debug-info in my test, and it works now. But why?<br></div><div><br></div>Thanks,<br></div>Zhenglin<br><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">2015-11-24 19:21 GMT+08:00 Pavel Labath <span dir="ltr"><<a href="mailto:labath@google.com" target="_blank">labath@google.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">HI,<br>
<br>
a couple of random shots in the dark:<br>
<br>
- could you paste the output of "frame variable --raw-output s"? (This<br>
disables lldb's type formatters. The goal is to see if the problem is<br>
in the formatter, or in lldb not finding the variable in the first<br>
place).<br>
<br>
- could you compile your test executable with -fno-limit-debug-info<br>
and see if that helps?<br>
<br>
pl<br>
<div><div class="h5"><br>
<br>
On 23 November 2015 at 02:15, 陶征霖 via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br>
><br>
> ---------- Forwarded message ----------<br>
> From: 陶征霖 <<a href="mailto:zhenglin.taozl@gmail.com">zhenglin.taozl@gmail.com</a>><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">llvm-dev@lists.llvm.org</a><br>
><br>
><br>
> Hi,<br>
><br>
> I build llvm+clang+lldb 3.7.0 from source code on centos7, the build command<br>
> is "cmake -DCMAKE_BUILD_TYPE=Release<br>
> -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DLLVM_LIBDIR_SUFFIX=64", there is<br>
> no error during building process.<br>
><br>
> And then I compile following c++ code using command "clang++ -std=c++11<br>
> -stdlib=libc++ -lc++abi -g t.cpp":<br>
> // t.cpp<br>
> #include <iostream><br>
> using namespace std;<br>
> int main() {<br>
> string s = "aa";<br>
> cout << s;<br>
> }<br>
> Try lldb to debug a.out, found that I can't print string s which shows<br>
> empty:<br>
> lldb a.out<br>
> (lldb) target create "a.out"<br>
> Current executable set to 'a.out' (x86_64).<br>
> (lldb) l<br>
> 4 int main() {<br>
> 5 string s = "aa";<br>
> 6 cout << s;<br>
> 7 }<br>
> (lldb) b 6<br>
> Breakpoint 1: where = a.out`main + 94 at t.cpp:6, address =<br>
> 0x0000000000400e5e<br>
> (lldb) r<br>
> Process 150 launched: '/root/a.out' (x86_64)<br>
> Process 150 stopped<br>
> * thread #1: tid = 150, 0x0000000000400e5e a.out`main + 94 at t.cpp:6, name<br>
> = 'a.out', stop reason = breakpoint 1.1<br>
> frame #0: 0x0000000000400e5e a.out`main + 94 at t.cpp:6<br>
> 3 using namespace std;<br>
> 4 int main() {<br>
> 5 string s = "aa";<br>
> -> 6 cout << s;<br>
> 7 }<br>
> (lldb) p s<br>
> (std::__1::string) $0 = {}<br>
><br>
> Could you please help point out what's wrong in my env? Thanks.<br>
><br>
> Thanks,<br>
> Zhenglin<br>
><br>
</div></div>> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
><br>
</blockquote></div></div></div></div></div>