I think Aaron added that code for when the language is not set, but he can clarify.<br><br>Off the top of my head I guess it helps with demangling symbols.  Eg you can’t demangle symbols from a TU without knowing what the language is.  There could be other reasons though.  For example each language is going to have an ABI with respect to the generated code.  This is used for unwinding, stepping, jitting code to run in the target, etc.  all of those could be affected by the language.<br><br>Maybe someone else can chime in with more reasons <br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 21, 2018 at 7:10 PM Vadim Chugunov <<a href="mailto:vadimcn@gmail.com">vadimcn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Would you mind going into a bit more detail on what sort of problems an unknown language could cause?   I'd like to understand the issue before jumping in to fix anything.  AFAIK, in the case of DWARF symbols, debug info for unknown languages is still used, so it wouldn't be the first for LLDB...<br></div><div><br></div><div></div><div>Also, the <a href="https://github.com/llvm-mirror/llvm/blob/baa88cf6cb85d4256bb0f806e1b4dc87b29ea98e/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp#L104" target="_blank">second fragment</a> checks for specific file extensions, which is an unreliable method, IMO, since there's more extensions in use for c++ alone.  Code could  also be generated by a template engine, which will probably use a different extension, etc.   I'd rather not just hardcode '.rs' for Rust.  <br></div><div>I was hoping Aaron could commend on why this is necessary (i.e. why not just trust the language flag?)</div><div><br></div><div>Thanks!</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 20, 2018 at 7:35 PM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Various parts of lldb require knowing the source language.  It’s possible that things will mostly work if you report that the language is c++, but you’ll probably get errors in other areas.  It goes all the way down to the CodeView level, where certain cv records indicate the original source language.  Can you check cvconst.h (ships with DIA SDK) and look for the enumeration corresponding to source language?  Does it have a value for Rust?  I’m guessing it doesn’t.  When you generate PDBs for Rust you probably need to put something unique value there, then we could properly set the language in lldb<br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 20, 2018 at 7:15 PM Vadim Chugunov <<a href="mailto:vadimcn@gmail.com" target="_blank">vadimcn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi!<br></div><div>I've been investigating why LLDB refuses to set breakpoints in Rust source files when using PDB debug info on Windows...  This seems to stem from a couple of checks <a href="https://github.com/llvm-mirror/lldb/blob/f6f930a3608daf81441d3c9051fd9cff84eb6d58/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp#L1509" target="_blank">here</a> and <a href="https://github.com/llvm-mirror/llvm/blob/baa88cf6cb85d4256bb0f806e1b4dc87b29ea98e/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp#L104" target="_blank">here</a>.    <br></div><div>I am wondering, what is the backstory there?  Are those still necessary?  I tried disabling them and Rust debugging worked just fine...</div><div><br></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>