<p dir="ltr"><br>
On Sep 12, 2015 4:45 AM, "Greg Stark via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> It seems like I get "<optimized out>" back from gdb when running on<br>
> clang -O2 binaries much more so than with gcc -O2. So much so that I<br>
> think it's not that they're optimized out but that I'm missing some<br>
> key flag to include some key piece of debugging info. I can't believe<br>
> that "t" here is optimized out entirely given that it's one of the<br>
> function parameters and it's a pointer to a complex structure. The<br>
> function is static so it is possible it was inlined but if the assert<br>
> is failing it's hard to see how the structure would be entirely<br>
> optimized out.<br>
><br>
> #2  0x00000000010ac7c7 in cdissect (v=<optimized out>, t=<optimized<br>
> out>, begin=<optimized out>, end=<optimized out>) at regexec.c:653<br>
> 653 assert(er != REG_NOMATCH || (t->flags & BACKR));<br>
> (gdb) p er<br>
> $1 = <optimized out><br>
> (gdb) p t<br>
> $2 = <optimized out><br>
><br>
> Is there some flag I should be giving to clang to get binaries that<br>
> will perform reasonably fast but still be possible to debug? How can I<br>
> tell why this variable is showing as optimized out?</p>
<p dir="ltr">Sorry answer to all the questions is, unfortunately, 'no'. Optimized debug info produced by llvm isn't ideal. There's still a lot of work to be done to make it good and it just hasn't been a priority for any of the contributors so far.</p>
<p dir="ltr">><br>
> --<br>
> greg<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</p>