<div dir="ltr">No, it shouldn't - clang attempts to avoid emitting duplicate debug info across the program (it assumes you built the whole program and all libraries with debug info), gcc assumes the same thing though in slightly different/fewer ways.<br><br>The solution is to install the -dbg build of your libstdc++ package (assuming you're using libstdc++), it will include debug info for the standard library, including std::string.<br><br>To see a case where GCC does the same thing - try a variable of type std::fstream. GCC, similarly, will produce only a declaration for the basic_fstream type, not the definition.<br><br>(& here's a lightning talk that discusses, briefly, some of this: <a href="https://www.youtube.com/watch?v=XvkLHIASlp8">https://www.youtube.com/watch?v=XvkLHIASlp8</a> )</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 25, 2019 at 11:41 AM Bob Eastbrook via cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fedora 30, "clang++ -g main.cc" does not emit debugging information<br>
for types such as std::string. I can only get complete debugging<br>
information by including "-fno-limit-debug-info".<br>
<br>
On Ubuntu 19.04, "clang++ -g" emits debugging info for std::string as expected.<br>
<br>
Which behavior of "-g" is correct? Can anyone explain why each<br>
platform behaves differently?<br>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div>