Yes the debug info does get bigger. But this is better than having the compiler omit the "std::string" definition so that you can't view stuff from the STL.
Greg > On Nov 24, 2015, at 7:22 PM, 陶征霖 via lldb-dev <lldb-dev@lists.llvm.org> wrote: > > Also I found that the size of my program binary increases from 140M to 180M > after -fno-limit-debug-info is added. Seems a lot of debug info is added? > > 2015-11-25 10:24 GMT+08:00 陶征霖 <zhenglin.ta...@gmail.com>: > Hi Pavel, > > Thanks for your reply. Seems lldb not finding the variable in the first place. > > * thread #1: tid = 154, 0x0000000000400e5e a.out`main + 94 at t.cpp:5, name = > 'a.out', stop reason = breakpoint 1.1 > frame #0: 0x0000000000400e5e a.out`main + 94 at t.cpp:5 > 2 using namespace std; > 3 int main() { > 4 string s = "aa"; > -> 5 cout << s; > 6 } > (lldb) frame variable --raw-output s > (std::__1::string) s = {} > > I added -fno-limit-debug-info in my test, and it works now. But why? > > Thanks, > Zhenglin > > > > 2015-11-24 19:21 GMT+08:00 Pavel Labath <lab...@google.com>: > HI, > > a couple of random shots in the dark: > > - could you paste the output of "frame variable --raw-output s"? (This > disables lldb's type formatters. The goal is to see if the problem is > in the formatter, or in lldb not finding the variable in the first > place). > > - could you compile your test executable with -fno-limit-debug-info > and see if that helps? > > pl > > > On 23 November 2015 at 02:15, 陶征霖 via lldb-dev <lldb-dev@lists.llvm.org> > wrote: > > > > ---------- Forwarded message ---------- > > From: 陶征霖 <zhenglin.ta...@gmail.com> > > Date: 2015-11-20 23:10 GMT+08:00 > > Subject: lldb doesn't work on centos7 > > To: llvm-...@lists.llvm.org > > > > > > Hi, > > > > 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. > > > > And then I compile following c++ code using command "clang++ -std=c++11 > > -stdlib=libc++ -lc++abi -g t.cpp": > > // t.cpp > > #include <iostream> > > using namespace std; > > int main() { > > string s = "aa"; > > cout << s; > > } > > Try lldb to debug a.out, found that I can't print string s which shows > > empty: > > lldb a.out > > (lldb) target create "a.out" > > Current executable set to 'a.out' (x86_64). > > (lldb) l > > 4 int main() { > > 5 string s = "aa"; > > 6 cout << s; > > 7 } > > (lldb) b 6 > > Breakpoint 1: where = a.out`main + 94 at t.cpp:6, address = > > 0x0000000000400e5e > > (lldb) r > > Process 150 launched: '/root/a.out' (x86_64) > > Process 150 stopped > > * thread #1: tid = 150, 0x0000000000400e5e a.out`main + 94 at t.cpp:6, name > > = 'a.out', stop reason = breakpoint 1.1 > > frame #0: 0x0000000000400e5e a.out`main + 94 at t.cpp:6 > > 3 using namespace std; > > 4 int main() { > > 5 string s = "aa"; > > -> 6 cout << s; > > 7 } > > (lldb) p s > > (std::__1::string) $0 = {} > > > > Could you please help point out what's wrong in my env? Thanks. > > > > Thanks, > > Zhenglin > > > > _______________________________________________ > > lldb-dev mailing list > > lldb-dev@lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev > > > _______________________________________________ > lldb-dev mailing list > lldb-dev@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev _______________________________________________ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev