In theory it probably could go into LLDB, but when we discussed this internally, we just decided that debug info goes in llvm on pure principle and for consistency. I also agree it would be nice for LLDB to use LLVM dwarf parser, but this needs some evangelism in the LLDB community before it can happen :)<br><br>There are potential use cases for PDB reading in llvm, for example llvm-symbolizer and ASAN, who i think have hand rolled PDB support, so there's definitely some merit to providing this kind of thing at the LLVM level, but that's more of a long term thing.<br><div class="gmail_quote">On Thu, Jan 29, 2015 at 11:52 AM Frédéric Riss <<a href="mailto:friss@apple.com">friss@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Jan 29, 2015, at 11:08 AM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br><div><div dir="ltr">See my earlier response to Adrian. But I'll rehash the point here, which is that basically in the short term, I think it makes the most sense to keep them separate. In the future, if / when we decide to provide a unified interface (e.g libDebugInfo as you suggest), there will be additional machinery required to wrap the two interfaces, so we could move the DIContext class at that time.<div><br></div><div>Does this make sense?<br></div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>Sure, no objection to moving files around :-)</div><div><br></div><div>Out of curiosity, if the only target users of the library are the dump tool and lldb, why put the code in LLVM and not only in LLDB? I would love to see LLDB using our Dwarf parser because there is quite some code duplication here, but it wouldn’t be the case for PDB support (again, not an objection, just a candide question).</div><div><br></div><div>Fred</div></div></div><div style="word-wrap:break-word"><div><div><br></div><blockquote type="cite"><div><div dir="ltr"><div><div class="gmail_quote">On Thu Jan 29 2015 at 10:54:37 AM Frédéric Riss <<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Jan 29, 2015, at 10:20 AM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br><div><div dir="ltr">I've been working on adding pdb reading support to llvm. This started as a tool for dumping info from a pdb (similar to llvm-dwarfdump), which has been checked in and currently has limited support for dumping pdb.<div><br></div><div>There's still more to be done on the pdb dumping tool, but at this point -- to reduce duplicated effort -- I think it makes the most sense to start moving some of this logic into a library in llvm, and then change llvm-pdbdump to use the library. Later, once the library is more comprehensive, I plan to then use it in LLDB for reading PDBs while debugging on Windows.</div><div><br></div><div>I think the best way to do this is to move all of the code in lib/DebugInfo to lib/DebugInfo/dwarf, and then make another folder called lib/DebugInfo/pdb. These would then be compiled into two separate libraries.</div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>so you would have libDebugInfoDWARF and libDebugInfoPDB. Would you still have libDebugInfo at all?</div><div><br></div><div>I ask because there is the DIContext abstraction that’s not tied to a particular debug format (It’s used by llvm-symbolizer, and I guess you have some interest in having that working on windows PDB files). But DIContext.cpp as one method, thus having a library for just that might be really overkill.</div></div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div dir="ltr"><div>Another approach is to just put the PDB code in the same folder as the dwarf code, but I don't like this approach for a number of reasons:</div><div><br></div><div>1) Not every consumer of DebugInfo wants both types of DebugInfo.</div><div>2) The pdb reading code relies <b>very heavily</b> on Windows APIs, and will not compile on other platforms. This is solvable with some CMake machinery, but it's ugly and unwarranted in my opinion.</div><div><br></div><div>So as a first step in this direction I'd like to propose moving the code in lib/DebugInfo to lib/DebugInfo/dwarf, and then updating the rest of llvm accordingly.</div><div><br></div><div>Thoughts? Comments? Suggestions?</div><div>Zach</div></div>
</div></blockquote></div></div></blockquote></div></div></div>
</div></blockquote></div></div></blockquote></div>